user1253847
user1253847

Reputation: 5451

Maven : How to avoid version appended to a war file in Maven?

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 .

Upvotes: 14

Views: 12874

Answers (4)

J. M. Becker
J. M. Becker

Reputation: 2835

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

<build>
  <finalName>${project.artifactId}</finalName>
</build> 

Upvotes: 9

Nirmalya
Nirmalya

Reputation: 1

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

Upvotes: -2

rk2010
rk2010

Reputation: 3529

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

Upvotes: -2

Tomasz Nurkiewicz
Tomasz Nurkiewicz

Reputation: 340963

Just add this to your pom.xml:

<build>
    <finalName>TataWeb</finalName>
</build>

Upvotes: 29

Related Questions