In a Maven project, how can I automatically update the version all child modules, plus the parent?

前端 未结 4 700
梦谈多话
梦谈多话 2021-01-30 02:05

I have a multi-module project.

parent POM (1.0-SNAPSHOT)
|-- module1 (1.0-SNAPSHOT)
|-- module2 (1.0-SNAPSHOT)
`-- module3 (1.0-SNAPSHOT)

When I execute m

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 02:16

    A flexible way to set poms versions, multi-modules projects included, is Versions Maven Plugin.

    mvn versions:set -DnewVersion=your_new_version
    

    It will adjust all pom versions, parent versions and children versions in a multi-module project.

    then

    mvn versions:commit
    

    or

    mvn versions:revert
    

提交回复
热议问题