You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Singh, Manish" <ms...@citistreetonline.com> on 2008/03/03 21:48:55 UTC

Problem providing project version via system property

Problem definition:
I have projects A,B,C,D,E
A,B and C are packaged together for application Y
A, D and E are packaged together for application Z

There is a parent project, Y defined whose pom includes A,B and C as
modules.
Thus A,B and C all point to Y as parent.

Similarly there is a parent project, Z defined whose pom includes A, D
and E as modules.
Now D and E both point to Z as parent, but A as mention above is
pointing to Y as parent.

When I do builds for parent projects Y or Z, everything builds fine.
But when I try doing the build for just D or E it fails complaining
about could not download artifact for G:Y:jar:${final.version} (trust
me, I have the system property defined)

A,B,C,D and E all belong to same GroupId G.

Project version in all my poms looks something like this,
<version>${final.version}</version>
Build done is fine with this system provided property but the installed
poms in local repository also keep this string as is and does not
replace actual version before creating those pom files in local
repository when I run mvn install.

I think my problem would be resolved if those poms had actual version
numbers in them.

Does anyone know why the installed pom does not get actual version
number and how to fix it?
Or any other solution to my problem above?

Thanks,
Manish

Y
Z--|
    |--A
    |--B
    |--C
    |--D
    |--E

Re: Problem providing project version via system property

Posted by Wayne Fay <wa...@gmail.com>.
You should be using the release plugin which will rewrite the
<version> tag along with SNAPSHOTs until you are ready for a final
release etc.

As you've discovered, the ${final.version} thing is a bad idea and
doesn't really work. If you check the archives, you'll see similar
posts from other people who have tried this before and eventually ran
into problems, and the advice given to them is also "use release
plugin".

Wayne

On 3/3/08, Singh, Manish <ms...@citistreetonline.com> wrote:
> Problem definition:
> I have projects A,B,C,D,E
> A,B and C are packaged together for application Y
> A, D and E are packaged together for application Z
>
> There is a parent project, Y defined whose pom includes A,B and C as
> modules.
> Thus A,B and C all point to Y as parent.
>
> Similarly there is a parent project, Z defined whose pom includes A, D
> and E as modules.
> Now D and E both point to Z as parent, but A as mention above is
> pointing to Y as parent.
>
> When I do builds for parent projects Y or Z, everything builds fine.
> But when I try doing the build for just D or E it fails complaining
> about could not download artifact for G:Y:jar:${final.version} (trust
> me, I have the system property defined)
>
> A,B,C,D and E all belong to same GroupId G.
>
> Project version in all my poms looks something like this,
> <version>${final.version}</version>
> Build done is fine with this system provided property but the installed
> poms in local repository also keep this string as is and does not
> replace actual version before creating those pom files in local
> repository when I run mvn install.
>
> I think my problem would be resolved if those poms had actual version
> numbers in them.
>
> Does anyone know why the installed pom does not get actual version
> number and how to fix it?
> Or any other solution to my problem above?
>
> Thanks,
> Manish
>
> Y
> Z--|
>    |--A
>    |--B
>    |--C
>    |--D
>    |--E
>

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