I've never tried overriding the version number in a child pom but I'd
guess it works. Give it a try and find out!
Basically dependencyManagement lets you specify...
parent-pom.xml
<dependencyManagement>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
</dependency>
</dependencyManagement>
child-pom.xml (note, no version #s specified)
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
</dependencies>
So the children all inherit the version # from the depMgmt in the
parent. You can also use this in profiles to specify exact version #s
for dependencies in specific profiles -- and can even change the
scope, so for profile=dev your commons-logging.jar is compile scope,
but profile=prod it uses provided, etc.
We've talked about this and provided a few examples on the user@ list
lately, so go search the archive and I'm sure you'll find lots more
info...
Wayne
On 4/4/06, Mang Jun Lau <[EMAIL PROTECTED]> wrote:
> Yes I believe so.
>
>
> _Mang Lau
>
>
>
>
>
> Arnaud Bailly <[EMAIL PROTECTED]>
> 04/04/2006 04:37 PM
> Please respond to
> "Maven Users List" <[email protected]>
>
>
> To
> "Maven Users List" <[email protected]>
> cc
>
> Subject
> Re: Shared projects and Maven best practice
>
>
>
>
>
>
> Didn't know about this <dependencyManagement> tag. This allows to
> specify default characteristics for a dependency that may be overriden
> by a pom ?
>
>
> --
> Arnaud Bailly, Dr. - Ingénieur de Recherche
> NORSYS
> 1, rue de la Cense des Raines
> ZAC du Moulin
> 59710 ENNEVELIN
> Tel : (33) 3 28 76 56 76
> Mob : (33) 6 17 12 19 78
> Fax : (33) 3 28 76 57 00
> Web : http://www.norsys.fr
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>