10

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,011
  • 10
  • 28
  • 28

4 Answers4

27

Just add this to your pom.xml:

<build>
    <finalName>TataWeb</finalName>
</build>
Tomasz Nurkiewicz
  • 324,247
  • 67
  • 682
  • 662
8

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

<build>
  <finalName>${project.artifactId}</finalName>
</build> 
J. M. Becker
  • 2,641
  • 29
  • 31
-1

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

rk2010
  • 3,401
  • 7
  • 26
  • 39
-1

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. – namalfernandolk Apr 21 '15 at 09:04