Mike
Mike

Reputation: 7924

Getting rid of version from JAR file in Maven POM?

In pom.xml, I've below entry which I'm using to create a JAR

<?xml version="1.0" encoding="UTF-8"?>
<project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>se.sigma.educational</groupId>
   <artifactId>my-jar</artifactId>
   <version>1.0</version>
   <packaging>jar</packaging>
   <name>Executable jar example</name>
     ....

Here, everything works fine & JAR gets created with name "my-jar-1.0.jar". Is there a way that I can create the JAR file name as "my-jar.jar" instead of having version within the name??? I tried removing attribute but then the pom.xml fails to run.

Any help is much appreciated, how do I get rid of version from the JAR file name?

Thanks!

Upvotes: 1

Views: 181

Answers (1)

Arpit
Arpit

Reputation: 6260

Well, there is a <finalName> property which lets you define a custom name of an artifact -

<build>
        <finalName>NAME_OF_JARFILE</finalName>
</build>

Upvotes: 1

Related Questions