[Turn] Maven module update father and version number, mvn versions: set

【From】https://www.cnblogs.com/ilovexiao/p/5663761.html

 

Pre-conditions:

1. Install JAVA guys have to eat and MAVEN.

First, we need to have a packaging pom.xml file type that is our parent pom pom project files. Configured groupId, artifactId, version and properties, prerequisites, dependencies in the parent project.

Another important item is the configuration modules. The version number will be updated at the same time to the execution sub-module maven version number of the update later joined the project.

Changing portion submodule:

<parent>
    <groupId>com.hlf</groupId>
    <artifactId>common-parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.hlf</groupId>
<artifactId>projectA</artifactId>

 

I found not here just put parent module version does not put sub-modules.

Then we execute:

>mvn versions:set -DnewVersion=0.0.2-SNAPSHOT

 

Will find all the version control file is generated in the parent maven modules and sub-modules below (let's call it so, although it looks is a file backup) pom.xml.versionsBackup.

At the same time, the parent modules and child modules are updated verion order 0.0.2-SNAPSHOT.

<parent>
    <groupId>com.hlf</groupId>
    <artifactId>common-parent</artifactId>
    <version>0.0.2-SNAPSHOT</version>
</parent>
<groupId>com.hlf</groupId>
<artifactId>projectA</artifactId>

 

Here the version number of the update has been completed sub-modules.

 

What? There? Then add a command bar

>mvn versions:update-child-modules

 

carry out!

 

Guess you like

Origin www.cnblogs.com/pekkle/p/10932266.html