Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set final jar name with maven-assembly-plugin version 3

In older versions of the plugin you could use <finalName>, but that does not exist any more. At the moment I am getting projectName-version-jar-with-dependencies.jar and it would be nice to change this.

like image 390
redsofa Avatar asked Jul 14 '17 10:07

redsofa


1 Answers

The finalName parameter is set in the project build section and not in the plugin configuration.

so essentially:

<build>
   <finalName>xyz</finalName>
   <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        ....
      </plugin>
   </plugins>
</build>

The assembly plugin gets the final name from reading the property ${project.build.finalName} and is a readonly parameter.

At least that´s what the code says: http://svn.apache.org/viewvc/maven/plugins/tags/maven-assembly-plugin-3.0.0/src/main/java/org/apache/maven/plugins/assembly/mojos/AbstractAssemblyMojo.java?view=markup

like image 56
Niels Bech Nielsen Avatar answered Sep 20 '22 03:09

Niels Bech Nielsen