You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ole Ersoy <ol...@yahoo.com> on 2006/12/03 01:34:32 UTC

Simple Depedency Management Rules

OK - I'm hijacking my own thread.

I think I have a simple rule / best practice
now for structuring dependencies. 

I would love feedback on this before I begin coding
the mojo that checks conformance. 

Here are the rules:

Keep all dependencies specified in the top 
level pom's dependencyManagement section.

Specify scope and version in child projects,
only when scope and version need to be
different from
those provided in the top level pom.

Thoughts?

Thanks,
- Ole

--- Ole Ersoy <ol...@yahoo.com> wrote:

> Hi,
> 
> I'm working on a mojo that will analyze a build's
> poms and come up with structuring recommendations.
> 
> For dependencies I had a simple rule in mind.
> 
> Keep them either on the parent or the child, unless
> one of the children has to override the parent's
> version setting...so this would only happen if a
> parent had 3 children, two of which needed the same
> version and a 3rd
> needing a different version.
> 
> However Maven also has the dependencyManagement
> element.
> Does that do something that the regular dependencies
> element does not?
> 
> Also, if anyone has other pom structuring rules /
> best
> practices they would like to see included in the
> report
> I'm accepting requests.  The report mojo will be
> apache licensed.
> 
> Cheers,
> - Ole
> 
> 
> 
> 
>  
>
____________________________________________________________________________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail
> beta.
> http://new.mail.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> For additional commands, e-mail:
> users-help@maven.apache.org
> 
> 



 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

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


Re: Simple Depedency Management Rules

Posted by Dan Tran <da...@gmail.com>.
pluginManagement is in <build>

  <build>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.1</version>
        </plugin>

     ....

-D



On 12/2/06, Wendy Smoak <ws...@gmail.com> wrote:
>
> On 12/2/06, Dan Tran <da...@gmail.com> wrote:
> > I did exactly that in my ~70 projects tree.
> >
> > one more rule,  nail down all plugin versions in the pluginManagement
> > section too.
>
> Hmmm... does that work for plugins that you don't 'declare' in child poms?
>
> If you're using the default config for a plugin, can you still fix the
> version number in <dependencyManagement> ?
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Simple Depedency Management Rules

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/2/06, Dan Tran <da...@gmail.com> wrote:
> I did exactly that in my ~70 projects tree.
>
> one more rule,  nail down all plugin versions in the pluginManagement
> section too.

Hmmm... does that work for plugins that you don't 'declare' in child poms?

If you're using the default config for a plugin, can you still fix the
version number in <dependencyManagement> ?

-- 
Wendy

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


Re: Simple Depedency Management Rules

Posted by Ole Ersoy <ol...@yahoo.com>.
Cool - Thanks D - That's definitely on the list

- Ole


--- Dan Tran <da...@gmail.com> wrote:

> I did exactly that in my ~70 projects tree.
> 
> one more rule,  nail down all plugin versions in the
> pluginManagement
> section too.
> 
> -D
> 
> 
> 
> 
> On 12/2/06, Ole Ersoy <ol...@yahoo.com> wrote:
> >
> > OK - I'm hijacking my own thread.
> >
> > I think I have a simple rule / best practice
> > now for structuring dependencies.
> >
> > I would love feedback on this before I begin
> coding
> > the mojo that checks conformance.
> >
> > Here are the rules:
> >
> > Keep all dependencies specified in the top
> > level pom's dependencyManagement section.
> >
> > Specify scope and version in child projects,
> > only when scope and version need to be
> > different from
> > those provided in the top level pom.
> >
> > Thoughts?
> >
> > Thanks,
> > - Ole
> >
> > --- Ole Ersoy <ol...@yahoo.com> wrote:
> >
> > > Hi,
> > >
> > > I'm working on a mojo that will analyze a
> build's
> > > poms and come up with structuring
> recommendations.
> > >
> > > For dependencies I had a simple rule in mind.
> > >
> > > Keep them either on the parent or the child,
> unless
> > > one of the children has to override the parent's
> > > version setting...so this would only happen if a
> > > parent had 3 children, two of which needed the
> same
> > > version and a 3rd
> > > needing a different version.
> > >
> > > However Maven also has the dependencyManagement
> > > element.
> > > Does that do something that the regular
> dependencies
> > > element does not?
> > >
> > > Also, if anyone has other pom structuring rules
> /
> > > best
> > > practices they would like to see included in the
> > > report
> > > I'm accepting requests.  The report mojo will be
> > > apache licensed.
> > >
> > > Cheers,
> > > - Ole
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
____________________________________________________________________________________
> > > Do you Yahoo!?
> > > Everyone is raving about the all-new Yahoo! Mail
> > > beta.
> > > http://new.mail.yahoo.com
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail:
> > > users-help@maven.apache.org
> > >
> > >
> >
> >
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Want to start your own business?
> > Learn how on Yahoo! Small Business.
> > http://smallbusiness.yahoo.com/r-index
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> > For additional commands, e-mail:
> users-help@maven.apache.org
> >
> >
> 



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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


Re: Simple Depedency Management Rules

Posted by Dan Tran <da...@gmail.com>.
I did exactly that in my ~70 projects tree.

one more rule,  nail down all plugin versions in the pluginManagement
section too.

-D




On 12/2/06, Ole Ersoy <ol...@yahoo.com> wrote:
>
> OK - I'm hijacking my own thread.
>
> I think I have a simple rule / best practice
> now for structuring dependencies.
>
> I would love feedback on this before I begin coding
> the mojo that checks conformance.
>
> Here are the rules:
>
> Keep all dependencies specified in the top
> level pom's dependencyManagement section.
>
> Specify scope and version in child projects,
> only when scope and version need to be
> different from
> those provided in the top level pom.
>
> Thoughts?
>
> Thanks,
> - Ole
>
> --- Ole Ersoy <ol...@yahoo.com> wrote:
>
> > Hi,
> >
> > I'm working on a mojo that will analyze a build's
> > poms and come up with structuring recommendations.
> >
> > For dependencies I had a simple rule in mind.
> >
> > Keep them either on the parent or the child, unless
> > one of the children has to override the parent's
> > version setting...so this would only happen if a
> > parent had 3 children, two of which needed the same
> > version and a 3rd
> > needing a different version.
> >
> > However Maven also has the dependencyManagement
> > element.
> > Does that do something that the regular dependencies
> > element does not?
> >
> > Also, if anyone has other pom structuring rules /
> > best
> > practices they would like to see included in the
> > report
> > I'm accepting requests.  The report mojo will be
> > apache licensed.
> >
> > Cheers,
> > - Ole
> >
> >
> >
> >
> >
> >
>
> ____________________________________________________________________________________
> > Do you Yahoo!?
> > Everyone is raving about the all-new Yahoo! Mail
> > beta.
> > http://new.mail.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > users-unsubscribe@maven.apache.org
> > For additional commands, e-mail:
> > users-help@maven.apache.org
> >
> >
>
>
>
>
>
> ____________________________________________________________________________________
> Want to start your own business?
> Learn how on Yahoo! Small Business.
> http://smallbusiness.yahoo.com/r-index
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>