release
plugin have update-versions
goal and autoVersionSubmodules option that sets submodules versions to parent project version.
Usage example here.
Now, if you have dependencies between your submodules (Module B
depends on Module A
), they won't be updated by release
plugin.
To work this out you can use ${project.version}
when defining dependency to Module A
in Module B
's pom.xml
.
For example (in Module B
's pom.xml
):
<dependency>
<groupId>test</groupId>
<artifactId>module-a</artifactId>
<version>${project.version}</version>
</dependency>
(this will work because both Module A
and Module B
versions are the same and derived from parent project version)