Reputation: 9502
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:
Class-Path: lib/log4j-1.2.16.jar
Instead I'm getting the following with the Class-Path section.
Class-Path: lib/log4j/log4j/1.2.16/log4j-1.2.16.jar
Here is my maven-jar-plugin setup:
<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>
Upvotes: 1
Views: 254
Reputation: 21
Change the version of maven-jar-plugin to 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.
Upvotes: 1