[英]Maven JAR plugin is adding the package name in front of “lib/log4j-1.2.16.jar” in Manifest Classpath
I'm trying to get Maven to create a JAR file with my dependencies in the lib directory and the classpath to specify something like: 我试图让Maven用lib目录中的依赖项和类路径创建一个JAR文件,以指定类似的内容:
Class-Path: lib/log4j-1.2.16.jar
Instead I'm getting the following with the Class-Path section. 相反,我在Class-Path部分获得了以下内容。
Class-Path: lib/log4j/log4j/1.2.16/log4j-1.2.16.jar
Here is my maven-jar-plugin setup: 这是我的maven-jar-plugin设置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<mode>development</mode>
<url>${project.url}</url>
<key>value</key>
</manifestEntries>
</archive>
</configuration>
</plugin>
Change the version of maven-jar-plugin to 3.0.2. 将maven-jar-plugin的版本更改为3.0.2。 See this issue for more details:
有关更多详细信息,请参见此问题:
MJAR-228 - Plugin generates wrong Class-Path in MANIFEST - Classpath is incorrectly generated using version 3.0.0. MJAR-228-插件在清单中生成错误的类路径 - 使用版本3.0.0错误生成类路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.