I've got these two pom files:
1) Parent pom.xml
...
<modules> <module>web-module</module> <module>interface-module</module> </modules> <dependencyManagement> <dependencies> <dependency> <groupId>${project.groupId}.${project.artifactId}</groupId> <artifactId>interface-module</artifactId> <version>${project.version}</version> <type>ejb</type> <scope>provided</scope> </dependency> </dependencies> </dependencyManagement> 2) Child pom.xml
<dependencies> <dependency> <groupId>${project.parent.groupId}.${project.parent.artifactId}</groupId> <artifactId>interface-module</artifactId> <version>${project.version}</version> <type>ejb</type> </dependency> </dependencies> The question is:
Why it can't resolve the dependency being managed by parent dependencyManagment with version omitted in the Child? Why do I have to specify the version while using dependencyManagment for submodule that is inherited from the Parent that is aggregating these modules? Maybe some advice?
UPD: Turned out that this behavior exists when groupId of the Child is changed and is not the one that is inherited from the Parent... Basically I have 2 submodules of the Parent one and they both are children of the Parent one. When I change the groupId in the Child module then it asks me to specify the version during dependency management which is kinda strange. Any ideas why maven is acting like that?