Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove version number from war file

I have a Dependency in child pom like this.

<dependencies>
        <dependency>
            <groupId>sample-groupID</groupId>
            <artifactId>sfint</artifactId>
            <version>1.0.0-SNAPSHOT</version>  
            <type>war</type>                
        </dependency>
</dependencies>

And I am using maven-ear-plugin.

 <plugins>
  <plugin>
   <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven.ear.plugin</artifactId>
    <version>2.10</version>
    <configuration>
            <modules>
                <webModule>
                    <groupId>sample-gropuID</groupId>
                    <artifactId>sfint</artifactId>
                    <version>1.0.0-SNAPSHOT</version>
                    <moduleID>WebModule_sfint</moduleID>
                    <bundleFileName>sfint.war</bundleFileName>  
                </webModule>
            </modules>  
    </configuration>
  </plugin>

Now my problem is that I want my war file to be like this - sfint.war but I am getting it as - sfint.1.0.0-SNAPSHOT.war

Any help ??

like image 870
rajan.sngh Avatar asked Oct 29 '15 10:10

rajan.sngh


People also ask

Is the name of jar without version?

artifactId is the name of the jar without version.

What is the use of Maven war plugin?

The WAR Plugin is responsible for collecting all artifact dependencies, classes and resources of the web application and packaging them into a web application archive.


1 Answers

Within the <build> tag specify the name that you need for the artifact as "finalName".

<build>
    <finalName>sfint</finalName>
</build>
like image 70
Gayan Mettananda Avatar answered Sep 21 '22 11:09

Gayan Mettananda