Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 .

like image 971
user1253847 Avatar asked May 11 '12 09:05

user1253847


People also ask

How do I exclude a WAR file?

It is possible to include or exclude certain files from the WAR file, by using the <packagingIncludes> and <packagingExcludes> configuration parameters. They each take a comma-separated list of Ant file set patterns.

What is WAR overlay?

Overlays are used to share common resources across multiple web applications. The dependencies of a WAR project are collected in WEB-INF/lib , except for WAR artifacts which are overlayed on the WAR project itself.

Why is Maven WAR plugin used?

The Maven WAR plugin is responsible for collecting and compiling all the dependencies, classes, and resources of the web application into a web application archive.


2 Answers

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

<build>
  <finalName>${project.artifactId}</finalName>
</build> 
like image 152
J. M. Becker Avatar answered Oct 29 '22 13:10

J. M. Becker


Just add this to your pom.xml:

<build>
    <finalName>TataWeb</finalName>
</build>
like image 39
Tomasz Nurkiewicz Avatar answered Oct 29 '22 14:10

Tomasz Nurkiewicz