I keep all version numbers in the dependencyManagement section of my parent POM, which is different from my aggregator POM and is parent to the aggregator and all its modules. In this way I specify each version exactly once. Something like:

<dependencyManagement>
<dependencies>
<dependency>
<groupId>bouncycastle</groupId>
<artifactId>bcprov-jdk13</artifactId>
<version>140</version>
</dependency>
</dependencyManagement>

dependencyManagement is a direct child of the project element.

Cheers,
Nicola Musatti

Ernst de Haan wrote:
- in the parent pom.xml, to denote the project version
you need this

- in each module, to denote the module version
just leave out the version and it will inherit it from the parent pom

- in each module's reference to the parent
you need this

- in each module's reference to a sibling
    <dependency>
      <groupId>${project.parent.groupId}</groupId>
      <artifactId>sibling-one</artifactId>
      <version>${project.parent.version}</version>
    </dependency>
Thanks a lot Kristian, this indeed improves the situation a *lot*. Instead of 
10 references for 3 modules, I am now able to reduce it to:

     1 + (1 per module)

However, I'll continue my quest to further reduction of replication, as my 
ultimate goal is still to have the version number in one place. Perhaps 
XInclude or so will do the trick.

Thanks heaps!


Ernst
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to