Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove -SNAPSHOT from project version in pom

I have a pom with the following GAV

<groupId>com.company.services</groupId>
<artifactId>test-branch-2</artifactId>
<version>1.0.21-SNAPSHOT</version>

I want to remove -SNAPSHOT from this using maven in batch mode, so I can do it with Jenkins and not have to specify anything manually.

I've looked at the documentation for version:set but all the options offer me an interactive prompt and ask me to type a name for the version.

I would prefer the versions plugin, not the release plugin.

like image 609
Jepper Avatar asked Aug 31 '25 15:08

Jepper


1 Answers

Since version 2.10 of the Versions Maven Plugin you can simply do:

mvn versions:set -DremoveSnapshot
like image 151
Rinke Avatar answered Sep 06 '25 13:09

Rinke