Typical use of dependencyManagement is to set version for commons libs in
parent POM, and to only refer to artifactId + groupId in children POM. This
ensure consistent versionning.

Other use case is to "fix" bad maven metadatas. For example, exclude logkit
&, avalon... from commons-logging.
This can be done in parent POM or even (this is my case) in corporate POM.



2007/12/21, Andrew Robinson <[EMAIL PROTECTED]>:
>
> <dependencyManagement> can be used to set common attributes for a dep,
> like exclusions, version etc.
>
> So:
>
> Parent P:
> <dependencyManagement>
> <dependency>
> <groupId>something</groupId>
> <artifactId>something</artifactId>
> <version>1.0.0</version>
> </dependency>
> </dependencyManagement>
>
> Child A & C:
> <dependencies>
> <dependency>
> <groupId>something</groupId>
> <artifactId>something</artifactId>
> </dependency>
> </dependencies>
>
> Child B doesn't use something
>
> Now I can change the version for something for both A and C in one place.
>
> Basically you want this if not all your child projects use a dependency.
>
> -Andrew
>
> On Dec 21, 2007 11:33 AM,  <[EMAIL PROTECTED]> wrote:
> > Say I have parent pom called A  and child pom called B. I specified
> > <module> element for B inside A and also
> > specified <parent> element for A inside B. Now I dont understand I
> > would have to declare <dependencyManagement> element in A. Say if I
> > have B, C, D as child modules and B, C, D all 3 depend on junit then
> > can I declare junit as dependency in A using <dependencies> element
> > instead <dependencyManagement> and in that B, C, D inherit that
> > <dependency> instead of each B, C, D declaring the dependency. If so
> > in what cases do I use <dependencyManagement>.
> >
> > I read the online documentation available at maven site but the
> > <dependencyManagement> documentation section is not clear to me. Can
> > anyone please explain <dependencyManagement> with an example.
> >
> > Thank you.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to