You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Todd Thiessen <th...@nortel.com> on 2008/12/08 16:31:35 UTC

POM Private Inheritence

>From reading the POM documenation here:

http://maven.apache.org/pom.html#Inheritance

it sounds like only certain sections of the POM get inheritied. For
instance, the SCM section is one section that is NOT mentioned as
inherited.

However, when I use m2e to show a pom's "effective" pom, it is pulling
in the scm section from the parent. Is this a bug of some kind? either
in m2e or maven?

---
Todd Thiessen

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


RE: POM Private Inheritence

Posted by Todd Thiessen <th...@nortel.com>.
Anyone have an insite here?

Having all elements of the super POM get inherited can be confusing if
not dangerous.

For instance, generating site information for a project which has not
overriden SCM information, will display SCM information for the parent
project, not the actual one.

Someone else observed similar behaviour for mailing lists.

I have read that plugins can be set to private inheritence but this
doesn't seem to apply to all sections of a POM.

Comments/suggestions?

---
Todd Thiessen
 

> -----Original Message-----
> From: Thiessen, Todd (BVW:9T16) 
> Sent: Monday, December 08, 2008 10:32 AM
> To: Maven Users List
> Subject: POM Private Inheritence
> 
> From reading the POM documenation here:
> 
> http://maven.apache.org/pom.html#Inheritance
> 
> it sounds like only certain sections of the POM get 
> inheritied. For instance, the SCM section is one section that 
> is NOT mentioned as inherited.
> 
> However, when I use m2e to show a pom's "effective" pom, it 
> is pulling in the scm section from the parent. Is this a bug 
> of some kind? either in m2e or maven?
> 
> ---
> Todd Thiessen
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


RE: POM Private Inheritence

Posted by Todd Thiessen <th...@nortel.com>.
Thanks. That is what I had observed also.

It would be nice if you could define sections like this as private.

---
Todd Thiessen
 

> -----Original Message-----
> From: Wendy Smoak [mailto:wsmoak@gmail.com] 
> Sent: Monday, December 15, 2008 1:56 PM
> To: Maven Users List
> Subject: Re: POM Private Inheritence
> 
> On Mon, Dec 15, 2008 at 11:45 AM, Todd Thiessen 
> <th...@nortel.com> wrote:
> 
> > What works out fine?  You mean that if the name of the 
> artifact ID is 
> > the name as the directory, the SCM section does not get inheritied??
> 
> The scm urls work out fine if you specify them only in the 
> parent pom, and have a hierarchical structure where the 
> artifact id matches the directory name.
> 
> > Are you suggesting that a parement POM should only be 
> referenced by a 
> > project only if that project is a child module of the parent POM?
> 
> No.
> 
>  > What
> > if you want to reference a parent POM that isn't the parent 
> of a child 
> > module?  For instance, when defining a corporation wide super POM.
> 
> In this case, make sure to specify the scm urls in the pom 
> that inherits from this corporation-wide super pom.  
> Otherwise, the url Maven would construct by inheriting the 
> scm url and adding the artifactId would not be correct.
> 
> --
> Wendy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: POM Private Inheritence

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Dec 15, 2008 at 11:45 AM, Todd Thiessen <th...@nortel.com> wrote:

> What works out fine?  You mean that if the name of the artifact ID is
> the name as the directory, the SCM section does not get inheritied??

The scm urls work out fine if you specify them only in the parent pom,
and have a hierarchical structure where the artifact id matches the
directory name.

> Are you suggesting that a parement POM should only be referenced by a
> project only if that project is a child module of the parent POM?

No.

 > What
> if you want to reference a parent POM that isn't the parent of a child
> module?  For instance, when defining a corporation wide super POM.

In this case, make sure to specify the scm urls in the pom that
inherits from this corporation-wide super pom.  Otherwise, the url
Maven would construct by inheriting the scm url and adding the
artifactId would not be correct.

-- 
Wendy

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


RE: POM Private Inheritence

Posted by Todd Thiessen <th...@nortel.com>.
Hmm. Not sure I follow.

What works out fine?  You mean that if the name of the artifact ID is
the name as the directory, the SCM section does not get inheritied??

Are you suggesting that a parement POM should only be referenced by a
project only if that project is a child module of the parent POM?  What
if you want to reference a parent POM that isn't the parent of a child
module?  For instance, when defining a corporation wide super POM.

---
Todd Thiessen
 

> -----Original Message-----
> From: Wendy Smoak [mailto:wsmoak@gmail.com] 
> Sent: Monday, December 15, 2008 1:35 PM
> To: Maven Users List
> Subject: Re: POM Private Inheritence
> 
> On Mon, Dec 8, 2008 at 8:31 AM, Todd Thiessen 
> <th...@nortel.com> wrote:
> 
> > http://maven.apache.org/pom.html#Inheritance
> >
> > it sounds like only certain sections of the POM get inheritied. For 
> > instance, the SCM section is one section that is NOT mentioned as 
> > inherited.
> 
> From experience, the scm section does get inherited as a base 
> url, then the artifactId of the child module is added.  If 
> you follow the convention that the directory name matches the 
> artifactId, it all works out fine.
> 
> If not, then you need to override the scm element in each pom 
> that does not conform.
> 
> You always need to have a scm element at the 'top' of each 
> directory tree, because the parent's scm urls won't be useful 
> as a base.
> 
> --
> Wendy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: POM Private Inheritence

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Dec 8, 2008 at 8:31 AM, Todd Thiessen <th...@nortel.com> wrote:

> http://maven.apache.org/pom.html#Inheritance
>
> it sounds like only certain sections of the POM get inheritied. For
> instance, the SCM section is one section that is NOT mentioned as
> inherited.

>From experience, the scm section does get inherited as a base url,
then the artifactId of the child module is added.  If you follow the
convention that the directory name matches the artifactId, it all
works out fine.

If not, then you need to override the scm element in each pom that
does not conform.

You always need to have a scm element at the 'top' of each directory
tree, because the parent's scm urls won't be useful as a base.

-- 
Wendy

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