You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jerome lacoste <je...@gmail.com> on 2006/05/04 15:48:45 UTC

specifying versions in sub-projects

Hi.

if I have

P1
  |- P2

Now P2 requires a particular version of a plugin, newer than the one
taken by default by P1.

After changing P2's pom, if I build from P2, then my P2 build will work.
But if I build from P1, P2 will fail.

My solution was to move the plugin-version specification in the root
pom, but I found that counter intuitive. Comments?

Jerome

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


Re: specifying versions in sub-projects

Posted by Wayne Fay <wa...@gmail.com>.
I believe the "right" way of doing this is by specifying a
<pluginManagement> in parent pom, and removing version numbers from
all plugin references everywhere else. ;-)

Wayne

On 5/4/06, jerome lacoste <je...@gmail.com> wrote:
> Hi.
>
> if I have
>
> P1
>   |- P2
>
> Now P2 requires a particular version of a plugin, newer than the one
> taken by default by P1.
>
> After changing P2's pom, if I build from P2, then my P2 build will work.
> But if I build from P1, P2 will fail.
>
> My solution was to move the plugin-version specification in the root
> pom, but I found that counter intuitive. Comments?
>
> Jerome
>
> ---------------------------------------------------------------------
> 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: specifying versions in sub-projects

Posted by jerome lacoste <je...@gmail.com>.
On 5/4/06, Feniks Nator <fe...@gmail.com> wrote:
> This in discussed in the book Better Builds with Maven which you find here
> (for free):
> http://www.mergere.com/m2book_download.jsp
> See the following sections:
> p54: 3.4 Managing Dependencies
> p.57: 3.6 Resolving dependency conflicts....
>
> I think those solutions are rather good.

The one thing that relates to what I am facing is the following:

"The version selected is the nearest to the top of the tree. [...] A
dependency in the POM being built will be used over anything else".
(3.6)

I don't really see why maven must take a decision, but I probably
don't have the full overview of the issues. Sub projects should work
on their own as well as when grouped, otherwise that makes aggregating
projects together a potential source of failure.

If I have P2 a sub module of P1, m2 could run P1 according to what is
defined in P1's pom, but P2 according to what is defined in P2's pom.
A user dependency version override should have a bigger precedence
over what is derived from the tool's implicit setup.

Anyway my issue's fixed and I know why it works like that, even though
I find it strange. Seems that I read that part of the book too fast.
Thanks for pointing me to the paragraphes.

Jerome

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


Re: specifying versions in sub-projects

Posted by Feniks Nator <fe...@gmail.com>.
This in discussed in the book Better Builds with Maven which you find here
(for free):
http://www.mergere.com/m2book_download.jsp
See the following sections:
p54: 3.4 Managing Dependencies
p.57: 3.6 Resolving dependency conflicts....

I think those solutions are rather good.


On 5/4/06, jerome lacoste <je...@gmail.com> wrote:
>
> Hi.
>
> if I have
>
> P1
>   |- P2
>
> Now P2 requires a particular version of a plugin, newer than the one
> taken by default by P1.
>
> After changing P2's pom, if I build from P2, then my P2 build will work.
> But if I build from P1, P2 will fail.
>
> My solution was to move the plugin-version specification in the root
> pom, but I found that counter intuitive. Comments?
>
> Jerome
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>