Unified version number management of maven parent and child modules

The first step is to introduce the maven version management plugin

	<build>
            <!-- 统一管理父子模块的版本号 -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
            </plugin>
        </plugins>
    </build>

The second step is to modify the version number uniformly through the maven command

mvn versions:set -DnewVersion=1.2.0-SNAPSHOT

The third step is to package and release

mvn clean deploy

Another: You can also roll back the version number

mvn versions:revert

Reference link: http://www.mojohaus.org/versions-maven-plugin/plugin-info.html

Guess you like

Origin blog.csdn.net/vcj1009784814/article/details/107719376