Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the Maven assembly plugin append the descriptor ref to the finalName value?

Tags:

java

maven-3

This is plugin configuration I am using:

<plugin>     <artifactId>maven-assembly-plugin</artifactId>     <configuration>         <archive>             <manifest>                 <mainClass>com.mycompany.changepasswd</mainClass>             </manifest>         </archive>         <finalName>changepasswd</finalName>         <descriptorRefs>             <descriptorRef>jar-with-dependencies</descriptorRef>         </descriptorRefs>     </configuration> </plugin> 

When I run mvn clean install assembly:single what I get is changepasswd-jar-with-dependencies.jar. How do I tell the assembly plugin to just name it changepasswd.jar? Or is that something which is handled outside of the assembly plugin?

like image 782
Mike Thomsen Avatar asked Oct 25 '11 14:10

Mike Thomsen


People also ask

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"

How does Maven Assembly plugin work?

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 tarLongFileMode?

tarLongFileMode: Sets the TarArchiver behavior on file paths with more than 100 characters length. Valid values are: "warn" (default), "fail", "truncate", "gnu", "posix", "posix_warn" or "omit".

What is fileset in Maven?

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


1 Answers

In your configuration element, try adding <appendAssemblyId>false</appendAssemblyId>. I believe this did the trick for me.

like image 89
G_H Avatar answered Oct 12 '22 14:10

G_H