I am using Maven for building my code. I created module based maven structure like below
- Parent-POM
- Sub-Parent1
- SP1_Child1
- SP1_Child2
- SP1_Child3
- Sub-Parent2
- SP2_Child1
- SP2_Child2
- SP2_Child3
- Sub-Parent1
All my module versions, and external dependency versions are maintained in the Parent POM. Everything works fine when I do a complete mvn install, but when I try to build one sub module like SP1_Child1, then the build fails, because it is not able to identify the version of its dependencies. I checked the maven repository in my local machine, and all my modules were installed, but the .POM files do not have the version numbers. This is probably because the where the mvn install on the Parent POM is not replacing the ${module.version} with the actual version for the child modules.
Parent-POM
<project ..> <groupId>the.company.project</groupId> <artifactId>Parent-POM</artifactId> <version>1.0-SNAPSHOT</version> ... <properties> <module.version>1.0</module.version> </properties> </project> SP1_Child1
<project ..> <parent> ... </parent> <groupId>the.company.project</groupId> <artifactId>SP1_Child1</artifactId> <version>${module.version}</version> ... </project> How how can my mvn install update the versions in the .POM files in the maven repository? Or how can I run one of my sub-modules without any version errors?