You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Remijan <mj...@yahoo.com> on 2011/08/11 19:51:22 UTC
Discrepancy in SNAPSHOT jar filename between JAR Plugin and Assembly Plugin
I am seeing an interesting discrepancy between the JAR plugin and the Assembly plugin.
I have the JAR plugin configured to add the dependencies to the MANIFEST:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
<mainClass>org.myapp.main.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
The JAR file name will be added to the MANIFEST like this. . .
Class-Path: lib/my-commons-1.0.6-SNAPSHOT.jar [...etc]
So far so good.
Now, I have the Assembly plugin configured to add the dependencies to the /lib directory of an archive:
<assembly>
....
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>/lib</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
</dependencySet>
</dependencySets>
</assembly>
When the Assembly plugin builds the archive, the name of the jarfile is NOT my-commons-1.0.6-SNAPSHOT.jar! Instead what I get is "my-commons-1.0.6-20110810.204640-23.jar"
$ ll my-commons*
-rwx------+ 1 mike Users Users 48805 Aug 11 08:53 my-commons-1.0.6-20110810.204640-23.jar
Major Problem!!
Anyone know why this is happening? I am using Maven 2.0.9 and I'm stuck with this version and cannot change it!
RE: Discrepancy in SNAPSHOT jar filename between JAR Plugin and
Assembly Plugin
Posted by Robert Scholte <rf...@codehaus.org>.
Looks like the assembly plugin uses somewhere artifact.getVersion() instead of artifact.getBaseVersion().
Please check if there's already such an issue at jira[1], otherwise create the issue yourself.
-Robert
[1] http://jira.codehaus.org/browse/MASSEMBLY
----------------------------------------
> Date: Thu, 11 Aug 2011 10:51:22 -0700
> From: mjremijan@yahoo.com
> Subject: Discrepancy in SNAPSHOT jar filename between JAR Plugin and Assembly Plugin
> To: users@maven.apache.org
>
> I am seeing an interesting discrepancy between the JAR plugin and the Assembly plugin.
>
> I have the JAR plugin configured to add the dependencies to the MANIFEST:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <configuration>
> <archive>
> <manifest>
> <addClasspath>true</addClasspath>
> <classpathPrefix>lib</classpathPrefix>
> <mainClass>org.myapp.main.Main</mainClass>
> </manifest>
> </archive>
> </configuration>
> </plugin>
>
> The JAR file name will be added to the MANIFEST like this. . .
>
> Class-Path: lib/my-commons-1.0.6-SNAPSHOT.jar [...etc]
>
> So far so good.
>
> Now, I have the Assembly plugin configured to add the dependencies to the /lib directory of an archive:
>
>
> <assembly>
> ....
> <dependencySets>
> <dependencySet>
> <useProjectArtifact>false</useProjectArtifact>
> <outputDirectory>/lib</outputDirectory>
> <useDefaultExcludes>true</useDefaultExcludes>
> </dependencySet>
> </dependencySets>
> </assembly>
>
> When the Assembly plugin builds the archive, the name of the jarfile is NOT my-commons-1.0.6-SNAPSHOT.jar! Instead what I get is "my-commons-1.0.6-20110810.204640-23.jar"
>
>
> $ ll my-commons*
> -rwx------+ 1 mike Users Users 48805 Aug 11 08:53 my-commons-1.0.6-20110810.204640-23.jar
>
> Major Problem!!
>
> Anyone know why this is happening? I am using Maven 2.0.9 and I'm stuck with this version and cannot change it!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org