Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the war name generated by maven assembly plugin

Tags:

maven-2

How can I change the name from 1.0.snapshot-jar-with-dependencies to something else, below are contents of my POM:

<build>     <plugins>         <plugin>             <artifactId>maven-assembly-plugin</artifactId>             <version>2.2-beta-5</version>             <configuration>                 <archive>                     <manifest>                         <mainClass>com.package.example.MainClass</mainClass>                     </manifest>                 </archive>                 <descriptorRefs>                     <descriptorRef>jar-with-dependencies</descriptorRef>                 </descriptorRefs>             </configuration>         </plugin>     </plugins> </build> 
like image 347
Gandalf StormCrow Avatar asked Jul 16 '10 13:07

Gandalf StormCrow


People also ask

How do I change my war name in Maven?

use the finalName tag to define/change the name of the war file in the web module that produces the war.

Can I rename a WAR file?

You can rename the WAR file if you are using a WAR file for deployment, and you want to use "Workplace XT" or a custom name for the context root of the application.

What is the use of 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.


1 Answers

Use the following in the configuration of the maven-assembly-plugin:

<configuration>   <finalName>custom-name</finalName>   <appendAssemblyId>false</appendAssemblyId> </configuration> 

Full details in the official documentation of the assembly:single mojo.

like image 194
Pascal Thivent Avatar answered Sep 21 '22 14:09

Pascal Thivent