(I assume you have a parent pom common to all of your modules.)
define a property in the parent pom:
<properties> <globaleVersion>1.0.0</globalVersion> </properties>
And define the <dependencyManagement> section in the parent pump:
<dependencyManagement> <dependencies> <dependency> <groupId>test</groupId> <artifactId>test</artifactId> <version>${globalVersion}</version> </dependency> <dependency> <groupId>A</groupId> <artifactId>A</artifactId> <version>${globalVersion}</version> </dependency> </dependencies> </dependencyManagement>
And your modules define dependencies without specifying the version (maven will find it from the parent's dependencyManagement section)
<dependencies> <dependency> <groupId>test</groupId> <artifactId>test</artifactId> </dependency> <dependency> <groupId>A</groupId> <artifactId>A</artifactId> </dependency> </dependencies>
ben75 source share