You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by gOrr <go...@gmail.com> on 2007/05/17 13:25:39 UTC
duplicate Class-Path problem
Hello.
I'm using maven-jar-plugin with "addClasspath" setting to true. The
META-INF/MANIFEST.MF file is being created fine (with the correct Class-path
value). My application needs several resources which should be added to the
classpath.
I have attempted to add resource folder in the "<manifestEntries>" tag, my
pom seems like:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<index>false</index>
<manifest>
<mainClass>path.to.my.MainClass</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>resources</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
When I add the "manifestEntries" the generated META-INF/MANIFEST.MF has got
two class-path enties:
Main-Class: path.to.my.MainClass
Class-Path: lib/lib1.jar lib/lib2.jar
Class-Path: resources
When I run the app I recieved the warning: "Duplicate name in Manifest:
Class-Path" and only the last "Class-Path" is added to the applicacion
classpath. Any idea to fix this problem?
i hope you can understand me, i know my english isn't very good. Thanks in
advance!!
Re: duplicate Class-Path problem
Posted by gOrr <go...@gmail.com>.
Hi.
I'm sorry, I reply myself. It was just a version problem, I have updated
maven and maven-jar-plugin and the bug has been fixed.
Bye.
On 5/17/07, gOrr <go...@gmail.com> wrote:
>
> Hello.
>
> I'm using maven-jar-plugin with "addClasspath" setting to true. The
> META-INF/MANIFEST.MF file is being created fine (with the correct Class-path
> value). My application needs several resources which should be added to the
> classpath.
>
> I have attempted to add resource folder in the "<manifestEntries>" tag, my
> pom seems like:
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <configuration>
> <archive>
> <index>false</index>
> <manifest>
> <mainClass>path.to.my.MainClass</mainClass>
> <addClasspath>true</addClasspath>
> <classpathPrefix>lib</classpathPrefix>
> </manifest>
> <manifestEntries>
> <Class-Path>resources</Class-Path>
> </manifestEntries>
> </archive>
> </configuration>
> </plugin>
>
> When I add the "manifestEntries" the generated META-INF/MANIFEST.MF has
> got two class-path enties:
> Main-Class: path.to.my.MainClass
> Class-Path: lib/lib1.jar lib/lib2.jar
> Class-Path: resources
>
> When I run the app I recieved the warning: "Duplicate name in Manifest:
> Class-Path" and only the last "Class-Path" is added to the applicacion
> classpath. Any idea to fix this problem?
>
> i hope you can understand me, i know my english isn't very good. Thanks in
> advance!!
>