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/02 23:17:18 UTC

POM Structuring Recommendations Report

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


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
>
>

Re: POM Structuring Recommendations Report

Posted by Ole Ersoy <ol...@yahoo.com>.
Yes!

Cool - It makes perfect sense.

Thanks for the reassurance.


--- Wendy Smoak <ws...@gmail.com> wrote:

> On 12/2/06, Ole Ersoy <ol...@yahoo.com> wrote:
> 
> > I'm leaning toward this as a best practice,
> because we
> > could have a build that has 3 modules and then we
> add
> > a 4th one, and if the parent had dependencies
> included
> > in the pom, the 4th module automatically gets
> them,
> > and maybe it didn't really want them.
> >
> > Thoughts?
> 
> That's exactly what <dependencyManagement> is for.
> 
> -- 
> Wendy
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> For additional commands, e-mail:
> users-help@maven.apache.org
> 
> 



 
____________________________________________________________________________________
Have a burning question?  
Go to www.Answers.yahoo.com and get answers from real people who know.

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


Re: POM Structuring Recommendations Report

Posted by Ole Ersoy <ol...@yahoo.com>.
Incidentally,

Do you by chance know if 
there is a way to make 
mvn eclipse:eclipse work
for a project with pom packaging?

This would be really nice for quickly
editing the dependencyManagement section
on a parent.

Thanks,
- Ole




--- Wendy Smoak <ws...@gmail.com> wrote:

> On 12/2/06, Ole Ersoy <ol...@yahoo.com> wrote:
> 
> > I'm leaning toward this as a best practice,
> because we
> > could have a build that has 3 modules and then we
> add
> > a 4th one, and if the parent had dependencies
> included
> > in the pom, the 4th module automatically gets
> them,
> > and maybe it didn't really want them.
> >
> > Thoughts?
> 
> That's exactly what <dependencyManagement> is for.
> 
> -- 
> Wendy
> 
>
---------------------------------------------------------------------
> 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: POM Structuring Recommendations Report

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/2/06, Ole Ersoy <ol...@yahoo.com> wrote:

> I'm leaning toward this as a best practice, because we
> could have a build that has 3 modules and then we add
> a 4th one, and if the parent had dependencies included
> in the pom, the 4th module automatically gets them,
> and maybe it didn't really want them.
>
> Thoughts?

That's exactly what <dependencyManagement> is for.

-- 
Wendy

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


Re: POM Structuring Recommendations Report

Posted by Ole Ersoy <ol...@yahoo.com>.
Hello again,

We were discussing this on the Apache directory dev
list as well, and Greg Duffy provided some
clarification.

So I attempted to come up with a best practice around
it.

If you have a chance it would be great to hear more
feedback on this.  Here is my answer to Greg.




OK - I think the lights are starting to turn on now.

If we put them in dependency management, they are not
automatically included, whereas if we put them in
dependencies, they are automatically included for all
children.

So if I were to write a best practice...

I could say that only dependency management should be
used in the parent, and dependencies should be
explicitly listed on each kid.

That way some of the kids don't end up with
dependencies they don't really need, and we have the
benefit of being able to update the version in one
place.

I'm leaning toward this as a best practice, because we
could have a build that has 3 modules and then we add
a 4th one, and if the parent had dependencies included
in the pom, the 4th module automatically gets them,
and maybe it didn't really want them.

Thoughts?

Thanks Greg,
- 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
> 
> 



 
____________________________________________________________________________________
Have a burning question?  
Go to www.Answers.yahoo.com and get answers from real people who know.

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


Simple Depedency Management Rules

Posted by Ole Ersoy <ol...@yahoo.com>.
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