Quantcast

does maven support multiple parents (multiple inheritance) ?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

does maven support multiple parents (multiple inheritance) ?

Marshall Schor
I see this doc [1] says there is support in maven internally for
multiple parents, including both <parents>
<parent>...</parent></parents> and <mixins><mixin>...</mixin><mixins>.
But the document implies that the maven model would need to be updated
to support this.

I tried using <parents> in a pom in both maven 2.2.1 and 3.0 alpha 6,
and both said it wasn't recognized.

I found this post [2] mentioning that Maven 3 will introduce the mixin
concept, but that it's not ready as of Feb 16th...

Any idea when it will be ready?

-Marshall

[1]
http://svn.apache.org/repos/asf/maven/components/branches/maven-3.0-mercury-763966/maven-project-spec.pdf

[2]
http://stackoverflow.com/questions/2271082/is-it-possible-to-split-maven-pom-files/2271118#2271118

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: does maven support multiple parents (multiple inheritance) ?

Wayne Fay
> I see this doc [1] says there is support in maven internally for
> multiple parents, including both <parents>

Any particular reason you can't use multiple levels of parents...
pom (grandparent)
+ pom (parent)
++ pom (child)

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: does maven support multiple parents (multiple inheritance) ?

Brian Fox-2
In reply to this post by Marshall Schor
> Any idea when it will be ready?

Requires a pom model change so 3.1+

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: does maven support multiple parents (multiple inheritance) ?

Marshall Schor
In reply to this post by Wayne Fay


On 4/3/2010 4:58 PM, Wayne Fay wrote:
>> I see this doc [1] says there is support in maven internally for
>> multiple parents, including both <parents>
>>    
> Any particular reason you can't use multiple levels of parents...
> pom (grandparent)
> + pom (parent)
> ++ pom (child)
>  

Here's my use case.  We have many (sub)projects, and several
aggregations of these into release "packages".  The subprojects share
various common attributes, which I'd like to factor into parents, but
along different dimensions.

For instance, some projects require a special extra build packaging step.

Other projects (may overlap with above set) do their documentation using
docbook - and I want to factor out for those common settings of the
docbkx maven plugin.

Because these sets of things are not in a hierarchical relationship, the
multiple-parent, or mixin style seems appropriate.  I would add to those
projects using the extra packaging step, a mixin for that, and for those
using docbook style documentation, a mixin for that.

-Marshall
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: does maven support multiple parents (multiple inheritance) ?

Harald Entner-2
each pom can only have one parent. but you can aggregate parents, eg. p1 is
parent of p2 and p2 is parent of p3 (as you shown above). in that case p3
inherits from both parents (to be exact: p2 inherits from p1 and p3 inherits
from p2).

2010/4/6 Marshall Schor <[hidden email]>

>
>
> On 4/3/2010 4:58 PM, Wayne Fay wrote:
> >> I see this doc [1] says there is support in maven internally for
> >> multiple parents, including both <parents>
> >>
> > Any particular reason you can't use multiple levels of parents...
> > pom (grandparent)
> > + pom (parent)
> > ++ pom (child)
> >
>
> Here's my use case.  We have many (sub)projects, and several
> aggregations of these into release "packages".  The subprojects share
> various common attributes, which I'd like to factor into parents, but
> along different dimensions.
>
> For instance, some projects require a special extra build packaging step.
>
> Other projects (may overlap with above set) do their documentation using
> docbook - and I want to factor out for those common settings of the
> docbkx maven plugin.
>
> Because these sets of things are not in a hierarchical relationship, the
> multiple-parent, or mixin style seems appropriate.  I would add to those
> projects using the extra packaging step, a mixin for that, and for those
> using docbook style documentation, a mixin for that.
>
> -Marshall
> > Wayne
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: does maven support multiple parents (multiple inheritance) ?

Wayne Fay
In reply to this post by Marshall Schor
> various common attributes, which I'd like to factor into parents, but
> along different dimensions.

I understand your use case. As Brian already stated, not going to
happen until 3.1 at the earliest.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: does maven support multiple parents (multiple inheritance) ?

stephenconnolly
In reply to this post by Marshall Schor
You do know that aggregation does not have to map with inheritance?

You can have an aggregator pom that is not the parent of the projects it
aggregates.

-Stephen

On 6 April 2010 18:45, Marshall Schor <[hidden email]> wrote:

>
>
> On 4/3/2010 4:58 PM, Wayne Fay wrote:
> >> I see this doc [1] says there is support in maven internally for
> >> multiple parents, including both <parents>
> >>
> > Any particular reason you can't use multiple levels of parents...
> > pom (grandparent)
> > + pom (parent)
> > ++ pom (child)
> >
>
> Here's my use case.  We have many (sub)projects, and several
> aggregations of these into release "packages".  The subprojects share
> various common attributes, which I'd like to factor into parents, but
> along different dimensions.
>
> For instance, some projects require a special extra build packaging step.
>
> Other projects (may overlap with above set) do their documentation using
> docbook - and I want to factor out for those common settings of the
> docbkx maven plugin.
>
> Because these sets of things are not in a hierarchical relationship, the
> multiple-parent, or mixin style seems appropriate.  I would add to those
> projects using the extra packaging step, a mixin for that, and for those
> using docbook style documentation, a mixin for that.
>
> -Marshall
> > Wayne
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Loading...