Maven : How to avoid version appended to a war file in Maven?
11,874
Solution 1
Just add this to your pom.xml
:
<build>
<finalName>TataWeb</finalName>
</build>
Solution 2
You should use your artifactid, rather than hard-coding the file name.
<build>
<finalName>${project.artifactId}</finalName>
</build>
Author by
user1253847
Updated on June 12, 2022Comments
-
user1253847 about 2 years
I am using Maven as the build file , this is my below settings for the war file name to be generated
I am using Maven version 2.2.1
<artifactId>TataWeb</artifactId> <packaging>war</packaging> <version>1.0</version>
So its actually generating a war file with this name TataWeb-1.0
But i want the war file name to be only TataWeb .
Please let me know how can i avoid the version appeneded to the war file name ??
Thank you .
-
user1253847 about 12 yearsI have 6 pom.xml files , one is parent one , where exactly i need to add this ??
-
Tomasz Nurkiewicz about 12 years@user1253847: in the
pom.xml
responsible for generating WAR file, i.e. the one with<packaging>war</packaging>
. -
user1253847 about 12 yearsYa i did that , but that did not work , still its generating with Tataweb-1.0.war , i have added the pom.xml file , please see .
-
Tomasz Nurkiewicz about 12 years@user1253847: are you sure you are building your application with
tata
profile? Because thefinalName
is defined only there. -
khmarbaise about 12 yearsThe finalName will only prevent adding the information in the target folder but will not prevent the information added during deployment.
-
Damien about 11 yearsEven though it is not the maven way, there are some cases when someone has to do this.
-
ironwood about 9 yearsBecause, this will not install it to the local maven repo. So, file name changing angle, it is similar to build/finalName solution given above IMO.
-
Charles Morin over 6 yearsMuch better like this. Thanks!