During development, we use a version of SNAPSHOT (e.g. 1.0-SNAPSHOT) for maven modules.
For example, the parent Maven Configugration module:
<groupId>com.mycomp.basemodule</groupId> <artifactId>base-module</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>base-module</name> <modules> <module>sub-module1</module> <module>sub-module2</module> <module>sub-module3</module> <module>sub-module4</module> </modules>
For example, the Maven Configugration child module:
submodule-1:
<parent> <groupId>com.mycomp.basemodule</groupId> <artifactId>base-module</artifactId> <version>1.0-SNAPSHOT</version> </parent> <groupId>com.mycomp.sub-module1</groupId> <artifactId>sub-module1</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <name>sub-module1</name>
Also consider the same configuration for other auxiliary modules (2,3,4).
When a project / patch is released, we need to change this version of SNAPSHOT to the actual version.
There is one rough way to change the version. I can go to each pom.xml for the parent and all child modules and change the version of SNAPSHOT to release the version.
Is there any other best practice for changing this version of SNAPSHOT to release the version in a common place, so that I do not need to update all the pom.xml files?
maven-3
Narendra verma
source share