You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sean McNamara <SM...@nyse.com> on 2006/04/17 23:42:48 UTC

Inherit version from parent project in multiproject build?

I've been trying to find an answer to this without much luck, but can't
believe nobody else has tried to do this.  Apologies in advance if the
answer is readily available... If so, my keywords must suck.

I've got a M2 multproject setup that builds several artifacts.

+ parent
-+ pom.xml
-+ child1
-+ child2

We want to assign the same version to each artifact in the multiproject
build, but it doesn't look like the version is actually an inheritable
field.  This means each time we want to build a new version, we need to
modify the POM for each child project, regardless of whether or not it
changed.

Is there some easy way to do this under Maven2?

Thanks!

*****************************************************************************

Note:  The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure.  If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it  from your system. Thank you.  NYSE Group.

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


Re: Inherit version from parent project in multiproject build?

Posted by Eric Redmond <er...@gmail.com>.
Children do inherit version from their parents (if the children do not set
the version element themselves).

Understand that there is a difference between a POM that aggregates other
projects, and a parent project. They are not necessarily related. A parent
POM is one that is explicitly pointed to by its children. They inherit their
parent's values. An aggregator (multimodule) POM, on the other hand, enacts
a common build over a set of modules (projects). But those modules do not
inherit from that POM (necessarily).

You'll still have the same issue with children inheriting from a version of
a parent POM. In order for a child to inherit from a different parent
version, then the child will have to explicitly point to the new parent
version, thus, negating your intent.

I remember talk of a plugin that could set versions by build, but I don't
know what came of it.

Eric

On 4/17/06, Sean McNamara <SM...@nyse.com> wrote:
>
>
> I've been trying to find an answer to this without much luck, but can't
> believe nobody else has tried to do this.  Apologies in advance if the
> answer is readily available... If so, my keywords must suck.
>
> I've got a M2 multproject setup that builds several artifacts.
>
> + parent
> -+ pom.xml
> -+ child1
> -+ child2
>
> We want to assign the same version to each artifact in the multiproject
> build, but it doesn't look like the version is actually an inheritable
> field.  This means each time we want to build a new version, we need to
> modify the POM for each child project, regardless of whether or not it
> changed.
>
> Is there some easy way to do this under Maven2?
>
> Thanks!
>
>
> *****************************************************************************
>
> Note:  The information contained in this message and any attachment to it
> is privileged, confidential and protected from disclosure.  If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited.  If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it  from your system. Thank you.  NYSE Group.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>