Maven gives you control over the name of your deliverable by using the finalName element, as in:
<!-- Inside your pom.xml -->
<build>
<finalName>whateverIWantToCallMyDeliverable</finalName>
</build>
May this suit you?
题
When bulding a executable jar with the maven-assembly-plugin and afterwards running it, it is recognized as a java application.
How could I manage that the jar is listed with it's application name ?
My POM:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>package.mainclass</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<!-- this is used for inheritance merges -->
<phase>package</phase>
<!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
解决方案
Maven gives you control over the name of your deliverable by using the finalName element, as in:
<!-- Inside your pom.xml -->
<build>
<finalName>whateverIWantToCallMyDeliverable</finalName>
</build>
May this suit you?