You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Maven User <ma...@gmail.com> on 2012/01/24 00:12:10 UTC

properties not getting shared

Hi all -

I've got a bit of a head scratcher here and while I know this isn't the
BEST way to solve things, it seems to be how it is getting done.

We have a parent pom that has a list of a few child modules.  In the parent
pom, we have a property that defines what version of a dependency we should
be resolving.

When building on the command line, sometimes it's easier just to do a
-Dfoo.version=2.1.2 for example to try out a different release of something.

Three of the five child poms get it correct.  The fourth keeps defaulting
to whatever is defined in the top level pom (and the fifth we never get to
see build).

I've looked at the GAV for the child pom and it's healthy (pointing to the
correct pom and everything).

What are we doing wrong?  This feels like a bug but I couldn't find one
documented like this...

Re: properties not getting shared

Posted by Maven User <ma...@gmail.com>.
Ok, a bit more clarity - the child build that fails has a dependency on
another child which has a dependency on something with ${foo.version}.

Once that dependency is attempted to be resolved transitively, the property
is NOT expanded to the -D value, but simply whatever was set in the top
level pom.



On Mon, Jan 23, 2012 at 6:12 PM, Maven User <ma...@gmail.com> wrote:

> Hi all -
>
> I've got a bit of a head scratcher here and while I know this isn't the
> BEST way to solve things, it seems to be how it is getting done.
>
> We have a parent pom that has a list of a few child modules.  In the
> parent pom, we have a property that defines what version of a dependency we
> should be resolving.
>
> When building on the command line, sometimes it's easier just to do a
> -Dfoo.version=2.1.2 for example to try out a different release of something.
>
> Three of the five child poms get it correct.  The fourth keeps defaulting
> to whatever is defined in the top level pom (and the fifth we never get to
> see build).
>
> I've looked at the GAV for the child pom and it's healthy (pointing to the
> correct pom and everything).
>
> What are we doing wrong?  This feels like a bug but I couldn't find one
> documented like this...
>