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 Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: