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

maven-assembly-plugin

Solution

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

Problem

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.

Original source