How to remove version number from war file

rajan.sngh picture rajan.sngh · Oct 29, 2015 · Viewed 9.1k times · Source

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 ??

Answer

Gayan Mettananda picture Gayan Mettananda · Oct 30, 2015

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

<build>
    <finalName>sfint</finalName>
</build>