This is what we use, to avoid having N different versions of commons jars. It's really helpfull.

However, I don't remember exactly if it works with a three level high project. With our structure, I think we limited the usage of dependencyManagement to the sub-projects (which have sub-projects themselves) because the other subprojects may be seen as standalone project. I don't know if this is the best idea, and I don't know if it was not driven by a bug we had in Maven some time ago.

It has to be investigate latter, when we will have time :)

Emmanuel

On 12/2/06, Greg Duffy <gduffy@gmail.com > wrote:
If you use regular dependencies in the parent project's POM, all the
subprojects inherit the dependencies.

With a dependencyManagement section in the parent POM, the subprojects
still have to explicitly declare a dependency in their own POM, but
the version is inherited from its entry in the parent's
dependencyManagement. That way, all of the dependency versions can be
changed from the same place.

On 12/2/06, Ole Ersoy <ole_ersoy@yahoo.com> wrote:
> Oooooooooh - I get it.  Thanks.
>
> Do you know if there is a benefit to
> using this instead of just
> regular dependencies?
>
>
> --- Alex Karasulu <akarasulu@apache.org > wrote:
>
> > Ole Ersoy wrote:
> > > Oh - OK - Should we delete the dependencies all
> > > together then, since the build will get them from
> > the
> > > parent?
> > >
> > > I'm putting this in as a quality control check in
> > the
> > > POM health check plugin.  It makes sense that
> > > dependencies should be on either the parent or the
> > > child.  Have we experienced any issues with this?
> > >
> >
> > Hmmm I think you misunderstood.  A
> > dependencyManagement area is not the
> > same as having deps in the parent that are inherited
> > by children.
> >
> > You still need the deps in the child poms.  The
> > versions are taken from
> > the dep mngment region.
> >
> > HTH,
> > Alex
> >
> >
> > > --- Alex Karasulu <akarasulu@apache.org> wrote:
> > >
> > >> Ole Ersoy wrote:
> > >>> I'm testing rpm spec file generation right on
> > >>> apache-server-main version 1.5 and noticed the
> > >>> following in the:
> > >>>
> > >>> Requires: nlog4j = null
> > >>>
> > >>> Requires: spring-core = null
> > >>>
> > >>> Requires: spring-beans = null
> > >>>
> > >>> Requires: commons-logging = null
> > >>>
> > >>> Requires: spring-context = null
> > >>>
> > >>> So these dependencies have no corresponding
> > >> version.
> > >>> I'll have a much more complete picture of the
> > >> whole
> > >>> build soon, but we may want to start updating
> > >> versions
> > >>> on all the poms.
> > >>>
> > >> I think this may be due to the use of a
> > >> dependencyManagement section in
> > >> the parent which lists the versions but the child
> > >> poms do not have a
> > >> version in the dependencies.
> > >>
> > >> Regards,
> > >> Alex
> > >>> begin:vcard
> > >> fn:Alex Karasulu
> > >> n:Karasulu;Alex
> > >> org:Apache Software Foundation;Apache Directory
> > >> adr:;;1005 N. Marsh Wind Way;Ponte Vedra
> > >> ;FL;32082;USA
> > >> email;internet:akarasulu@apache.org
> > >> title:Member, V.P.
> > >> tel;work:(904) 791-2766
> > >> tel;fax:(904) 808-4789
> > >> tel;home:(904) 808-4789
> > >> tel;cell:(904) 315-4901
> > >> note;quoted-printable:AIM: alexokarasulu=0D=0A=
> > >>    MSN: aok123@bellsouth.net=0D=0A=
> > >>    Yahoo!: alexkarasulu=0D=0A=
> > >>    IRC: aok=0D=0A=
> > >>    PGP ID: 1024D/4E1370F8 BBCC E8D8 8756 2D51 C3D4
> > >> 014A 3662 F96F 4E13 70F8=0D=0A=
> > >>
> > >> x-mozilla-html:FALSE
> > >> url:http://people.apache.org/~akarasulu
> > >> version:2.1
> > >> end:vcard
> > >>
> > >>
> > >
> > >
> > >
> > >
> > >
> >
> ____________________________________________________________________________________
> > > Do you Yahoo!?
> > > Everyone is raving about the all-new Yahoo! Mail
> > beta.
> > > http://new.mail.yahoo.com
> > >
> >
> > > begin:vcard
> > fn:Alex Karasulu
> > n:Karasulu;Alex
> > org:Apache Software Foundation;Apache Directory
> > adr:;;1005 N. Marsh Wind Way;Ponte Vedra
> > ;FL;32082;USA
> > email;internet:akarasulu@apache.org
> > title:Member, V.P.
> > tel;work:(904) 791-2766
> > tel;fax:(904) 808-4789
> > tel;home:(904) 808-4789
> > tel;cell:(904) 315-4901
> > note;quoted-printable:AIM: alexokarasulu=0D=0A=
> >       MSN: aok123@bellsouth.net=0D=0A=
> >       Yahoo!: alexkarasulu=0D=0A=
> >       IRC: aok=0D=0A=
> >       PGP ID: 1024D/4E1370F8 BBCC E8D8 8756 2D51 C3D4
> > 014A 3662 F96F 4E13 70F8=0D=0A=
> >
> > x-mozilla-html:FALSE
> > url:http://people.apache.org/~akarasulu
> > version:2.1
> > end:vcard
> >
> >
>
>
>
>
> ____________________________________________________________________________________
> Cheap talk?
> Check out Yahoo! Messenger's low PC-to-Phone call rates.
> http://voice.yahoo.com
>



--
Cordialement,
Emmanuel Lécharny