Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update the maven version without pom backup files

How do you run maven with the versions plugin to update the version inside several pom.xml files and not get the annoying pom.xml.versionsBackup files? (I have my poms in version control, so I don't need a backup).

I run this command to update the version:

mvn versions:set -DnewVersion=3.8.0-SNAPSHOT

like image 278
Jess Avatar asked Apr 12 '13 18:04

Jess


People also ask

What is Mvn versions commit?

Description: Removes the initial backup of the pom, thereby accepting the changes.


2 Answers

To prevent creating backup files, use generateBackupPoms instead:

mvn versions:set -DgenerateBackupPoms=false -DnewVersion=3.9.0-SNAPSHOT

I also saw that you can set up generateBackupPoms in the plugin section of a pom.xml if you want to do it that way.

Note if you are using eclipse, you can run the command using a run configuration like this:

enter image description here

See also: http://www.mojohaus.org/versions-maven-plugin/set-mojo.html

like image 181
Jess Avatar answered Sep 23 '22 10:09

Jess


After mvn versions:set, run the command mvn versions:commit.

All of the pom backups will be deleted.

like image 39
eXistPierre Avatar answered Sep 25 '22 10:09

eXistPierre