12

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
  • 5,241
  • 10
  • 29
  • 28

4 Answers4

28

Just add this to your pom.xml:

<build>
    <finalName>TataWeb</finalName>
</build>
Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
9

You should use your artifactid, rather than hard-coding the file name.

<build>
  <finalName>${project.artifactId}</finalName>
</build> 
J. M. Becker
  • 2,755
  • 30
  • 32
-1

well, its not the Maven Way. Maven does have a version attribute.. use it.

rk2010
  • 3,481
  • 7
  • 27
  • 39
-2

You can avoid the version appeneded to the war file name by doing a "clean compile package" instead of "clean install".

  • Because, 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. – ironwood Apr 21 '15 at 09:04