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
Make sure all sub-projects versions are the same to their parent's version.
com.xyz
module-1
jar
com.xyz
xyz-parent
1.0.123-SNAPSHOT
4.0.0
xyz-parent
com.xyz
1.0.123-SNAPSHOT
pom
xyz-parent
com.xyz
module-1
${project.version}
com.xyz
module-2
${project.version}
Create another pom.xml to group those project together.
../xyz-parent
../module-1
../module-2
Then update the parent project's version and then build it by below command.
mvn versions:set -DnewVersion=1.0.1004-SNAPSHOT
mvn clean install
Then update the parent's version which is defined in those sub-project to the latset one
mvn -N versions:update-child-modules
Then build them together.
@echo on
cd .\xyz-parent
call mvn versions:set -DnewVersion=1.0.1004-SNAPSHOT -o
call mvn versions:commit -o
call mvn clean install -o
:::http://www.mojohaus.org/versions-maven-plugin/examples/update-child-modules.html
cd ..\xyz-buildaggregate-ide
call mvn -N versions:update-child-modules -o
call mvn clean install -o