I have 3 poms
in my projects, 1 for parent and 2 for each of the modules
in use.
Each pom currently contains <version>2.1.9.0-SNAPSHOT</version>
tag
Is it possible for each of the modules to pull this information form the parent automatically?
I have 3 poms
in my projects, 1 for parent and 2 for each of the modules
in use.
Each pom currently contains <version>2.1.9.0-SNAPSHOT</version>
tag
Is it possible for each of the modules to pull this information form the parent automatically?
In a multi-module build only the parent should define the versions of the artifacts except in the parents.
+-- root (pom.xml)
+-- mod-1 (pom.xml)
+-- mod-2 (pom.xml)
So the root pom.xml looks like (excerpt):
<project...>
<groupId>project.com.root</groupId>
<artifactId>project-parent</artifactId>
<version>1.0-SNAPSHOT</version>
...
every module (mod-1) pom.xml looks like (excerpt):
<project...>
<parent>
<groupId>project.com.root</groupId>
<artifactId>project-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>mod-1</artifactId>
In particular the version should never be mentioned in the childs. The changing of the version number at all should be done via the maven-release-plugin during a release cycle. Sometimes it can happen that you change the groupId in the childs in larger projects with quite large number of modules.