maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Dahanne <anthony.daha...@gmail.com>
Subject snapshot versions and classpath stored in manifest
Date Mon, 07 Jan 2013 16:26:52 GMT
Hello all,
I am using Maven 3 with Nexus 2.
I am building a cli tool (let's call it cli) , which has dependencies on
some other libraries (let's call them dependencyA and dependencyB)
To make my cli tool work in every environment, I rely on the manifest
classpath, generated with :
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
    <archive>
      <manifest>
        <addClasspath>true</addClasspath>
      </manifest>
    </archive>
  </configuration>
</plugin>

and then I package everything (cli and its dependencies) using an assembly

my launcher script looks like :
java -jar cli*.jar (the * is there so that I won't need to update the
script for any versions)

If I build everything locally, in version 1.1.0-SNAPSHOT, here is the
manifest classpath entry :
Class-Path: dependencyA-1.1.0-SNAPSHOT.jar dependencyB-1.1.0-S
 NAPSHOT.jar  slf4j-jdk14-1.6.6.jar slf4j-api-1.6.6.jar

locally, everything is fine

Now, if I download the assembly, built by a CI tool and published to Nexus,
the manifest is still the same, but look at the names of the dependencies :
~> ls lib/
cli-1.1.0-20130105.224257-7.jar  dependencyA-1.1.0-20130105.224257-7.jar
dependencyB-1.1.0-20130105.224257-7.jar

As you can imagine, the cli won't find it's dependencies since their
version does not match any more the manifest's (SNAPSHOT in the manifest,
1.1.0-20130105.224257-7 is what we have)

It seems like this issue was fixed some time ago :
http://jira.codehaus.org/browse/MJAR-28

Is is a regression ?

Thanks a lot for your help!
Anthony

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message