user994165
user994165

Reputation: 9502

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:

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

Answers (1)

M&#225;rio Aguiar
M&#225;rio Aguiar

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

Related Questions