# Version Management

This document is about Version Management of Sermant.

Sermant manages versions via versions-maven-plugin (opens new window). Common commands are as follows:

  • Update current version to ${version}

    mvn versions:set -DnewVersion=${version}
    

    This command keeps the original pom file backup by default.

  • Rollback the version:

    mvn versions:revert
    
  • Commit the new version updated (delete the original pom file backup):

    mvn versions:commit
    
  • Update current version to ${version} and commit:

    mvn versions:set -DnewVersion=${version} -DgenerateBackupPoms=false
    

    This command will not back up the original pom file, be careful not to write the wrong version number when executing it.

After executing the above update commands, only the modules with the same version as the top-level module in the project will be modified. If you need to update a module separately, you can specify it with -pl, for example:

mvn versions:set -DnewVersion=${version} -DgenerateBackupPoms=false -pl ${module}

Where ${module} can be ${groupId}:${artifactId}. Or you can input relative path of the module. In the case of multiple modules, please use ','.

For more information on setting versions with the versions:set command, refer to Versions Maven Plugin versions:set (opens new window).

Refer to Versions Maven Plugin Introduction (opens new window) for more versions-maven-plugin commands.

Last Updated: 4/1/2024, 3:31:21 AM