Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override maven-assembly-plugin output file name

Is it possible to override the default name of the jar file created running the assembly:single goal? I want to add a jar with dependencies that has a non-standard name. I am using version 2.6 of the plugin.

like image 227
softweave Avatar asked Nov 12 '15 14:11

softweave


People also ask

What is fileset in Maven?

Defines the rules for matching and working with files in a given base directory. Element.

What is assembly descriptor in Maven?

This descriptor specifies the type of assembly archive to create, the contents of the assembly, and the ways in which dependencies or its modules are bundled with an assembly. <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

What is the Maven Assembly plugin?

The Assembly Plugin for Maven enables developers to combine project output into a single distributable archive that also contains dependencies, modules, site documentation, and other files. Your project can easily build distribution "assemblies" using one of the prefabricated assembly descriptors.

What is goal single in Maven?

This goal is suitable either for binding to the lifecycle or calling directly from the command line (provided all required files are available before the build starts, or are produced by another goal specified before this one on the command line).


1 Answers

Yes, you need to use the finalName configuration attribute. Note that you probaby also want to remove the assembly id that is appended by default to the final name, with the help of the appendAssemblyId attribute.

Sample configuration:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.6</version>
  <configuration>
    ...
    <finalName>myFinalName</finalName>
    <appendAssemblyId>false</appendAssemblyId>
  </configuration>
</plugin>
like image 117
Tunaki Avatar answered Oct 03 '22 20:10

Tunaki