Maven: Updating Artefact Version in a Multi-Module Project

Using following Maven command, the version of artifacts can be updated in a multi-module maven project.

mvn versions:set -DnewVersion='new-version'

For instance, the following maven command updates the version in POM.xml files of the enclosed moduels to 7.1.0-DEV-SNAPSHOT.

mvn versions:set -DnewVersion='7.1.0-DEV-SNAPSHOT'

Note that, by default this command creates a backup of the existing POM files. In essence, it creates a pom.xml.versionBackup for each POM file. This behavior can be disabled as follows.

mvn versions:set -DnewVersion='7.1.0-DEV-SNAPSHOT' -DgenerateBackupPoms=false

Leave a comment

Design a site like this with WordPress.com
Get started