I'm trying to package my application with its dependencies such that the main
jar file is executable. That means have a Class Path entry in the Manifest of
the main jar. I can get this to work with the following in my pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.copart.handheld.Main</mainClass>
<packageName>com.copart.handheld</packageName>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
That puts entries into the Manifest like the following:
Class-Path: someJar-1.0-SNAPSHOT.jar anotherJar-1.0-SNAPSHOT.jar yetA
notherJar-1.0-SNAPSHOT.jar
This is what I want.
However, when I use the Assembly plugin to create a ZIP file and instruct it to
include the dependent jars, I can't get it to name them like the above. I'm
using the following tag:
<outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
That produces jars like:
someJar.jar
anotherJar.jar
yetAnotherJar.jar
If I use:
<outputFileNameMapping>${artifactId}-${version}.${extension}</outputFileNameMapping>
I get:
someJar-1.0-20051031.184027-1.jar
anotherJar-1.0-20051031.182639-1.jar
yetAnotherJar-1.0-20051031.183047-1.jar
Is there any way to produce jars with the -1.0-SNAPSHOT version number?
K.C.