I'm struggling with updating version of module. My project is huge (around 50 modules) but I will simplify it for an example purpouse.
-moduleA
-moduleA1
-pom.xml
-pom.xml
-moduleB
-moduleB1
-pom.xml
-pom.xml
-pom.xml
What I want to do. Lets's assume one version in every pom.xml - 5.0.0. ModuleA1 pomx looks like:
<parent>
<groupId>com.sample.project</groupId>
<artifactId>moduleA</artifactId>
<version>5.0.0</version>
</parent>
<groupId>com.sample.project.moduleA</groupId>
<artifactId>moduleA1</artifactId>
<version>5.0.0</version>
Now I want to increase version of moduleA1. So...
mvn -N versions:set -DnewVersion=5.0.1 -DgroupId=com.sample.project.moduleA -DartifactId=moduleA1
ModuleB1 has dependency to moduleA1
<parent>
<groupId>com.sample.project</groupId>
<artifactId>moduleB1</artifactId>
<version>5.0.0</version>
</parent>
<groupId>com.sample.project</groupId>
<artifactId>moduleB1</artifactId>
<version>5.0.0</version>
<dependency>
<groupId>com.sample.project.moduleA</groupId>
<artifactId>moduleA1</artifactId>
<version>5.0.0</version>
</dependency>
Version of this dependency should be updated and it is but only for the first time *when version is the same as parent). If I want to update it to 5.0.2 this dependency will not be changed it will stay 5.0.1 (only pointed moduleA1 will be updated to 5.0.2) I tried to use dependencyManegement but the result was exactly the same. Any ideas how to force maven to update pointed module and dependencies of its module on other modules?