Default JAR name different than the one placed in MANIFEST.MF
-------------------------------------------------------------
Key: MASSEMBLY-145
URL: http://jira.codehaus.org/browse/MASSEMBLY-145
Project: Maven 2.x Assembly Plugin
Issue Type: Bug
Affects Versions: 2.1
Reporter: Dimitar Dimitrov
I'm not sure whether this is a problem in the Assembly or the Jar plugin.
My build uses the Class-Path attribute in the JAR manifest of an application
jar, so we can launch our apps using 'java -jar app.jar'
The problem is that for artifacts with classifier, the jar plugin produces
entry like ${artifact-id}-${version}-${classifier}.jar, while the assembly
plugin copies them as ${artifact-id}-${version}-${classifier}.jar
This forces us to do some build postprocessing, which is in the best case
annoying.
SUGGESTED FIX:
Adopt the Jar plugin behaviour as default. This won't be noticed in the
majority of the existing projects, as most of the artifacts don't use
classifiers.
If anybody needs the curent behaviour, they can customize
outputFileNameMapping. We cannot keep the current default and use the
outputFileNameMapping as if we specify
${artifactId}-${version}-${classifier}.${extension}, there is a trailing dash
when the classifier is empty.
Here is an excerpt from a build log illustrating the problem:
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-assembly-plugin:2.0.1:assembly' -->
[DEBUG] (f) basedir = C:\sandbox\fidessa-foxbridge
[DEBUG] (f) dependencies = [org.safehaus.jug:jug:jar:asl:2.0.0:compile,
xpp:xpp:jar:1.1.3.4d_b4_min:compile]
[DEBUG] (f) descriptors = [Ljava.io.File;@1f78040
[DEBUG] (f) finalName = fidessa-foxbridge-1.0-SNAPSHOT
[DEBUG] (f) includeSite = false
[DEBUG] (f) outputDirectory = C:\sandbox\fidessa-foxbridge\target
[DEBUG] (f) project = [EMAIL PROTECTED]
[DEBUG] (f) siteDirectory = C:\sandbox\fidessa-foxbridge\target\site
[DEBUG] (f) tempRoot = C:\sandbox\fidessa-foxbridge\target\archive-tmp
[DEBUG] (f) workDirectory = C:\sandbox\fidessa-foxbridge\target\assembly\work
[DEBUG] -- end configuration --
[INFO] [assembly:assembly]
... snipped building the temp dir ...
[INFO] Building jar:
C:\sandbox\fidessa-foxbridge\target\fidessa-foxbridge-1.0-SNAPSHOT-distro.jar
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory lib/
[DEBUG] adding entry lib/jug-2.0.0.jar
[DEBUG] adding entry lib/xpp-1.1.3.4d_b4_min.jar
[DEBUG] adding entry lib/fidessa-foxbridge-1.0-SNAPSHOT.jar
[DEBUG] adding entry META-INF/distro.xml
[DEBUG] adding entry META-INF/pom.xml
The manifest Class-Path refers jug-2.0.0-asl.jar, while the distribution
contains jug-2.0.0.jar
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira