I will not try to solve the problem of your current approach, but rather consider what I consider the best in this case. Feel free to accept it or not :)
First of all, note that RELEASE (and LATEST ) is a special keyword (not sure if you know about it) and RELEASE somehow misused (parent with version, t20> doesn't really make sense). In any case, these special keywords were a bad idea and deprecated (I'm not sure if they are supported in Maven3) in order to create reproducibility, just don't use them.
So, use the SNAPSHOT version if the project is under active development, and do not change the parent element as follows:
<project> <modelVersion>4.0.0</modelVersion> <groupId>com.domain</groupId> <artifactId>Parent</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>Parent</name> <modules> <module>../Child1</module> <module>../Child2</module> <module>../Child3</module> <module>../Child4</module> <module>../Child5</module> </modules> </project>
Note that I removed the dependencyManagement element, I donβt think it provides a lot of added value for the internal dependencies of the assembly of several modules and recommends using ${project.groupId} and ${project.version} instead, declaring them:
<project> <modelVersion>4.0.0</modelVersion> <parent> <artifactId>Parent</artifactId> <groupId>com.domain</groupId> <version>1.0-SNAPSHOT</version> </parent> <artifactId>Child3</artifactId> <packaging>war</packaging> <name>Child3</name> <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>Child1</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>Child2</artifactId> <version>${project.version}</version> </dependency> </dependencies> </project>
As I already wrote, I donβt think that using dependencyManagement really useful for dependencies inside and how I set up my projects. But you can if you want. Just use properties to not repeat information.
source share