maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Heinz Marbaise <khmarba...@gmx.de>
Subject Re: Reactor projects and ${project.version}
Date Wed, 16 Sep 2015 05:44:24 GMT
Hi,

On 9/16/15 1:50 AM, Jordan Zimmerman wrote:
> Is there any way (using plugins, whatever) to get a stable reference to the root project
version? Here is what I’m trying to do. I have a reactor project:
>
> pom.xml
>          module1/pom.xml
>          module2/pom.xml
>
> The wrinkle is that the root pom.xml has a parent (for example foo:bar:1.2).
 > foo.bar has several of its own modules that I want to use.
 >  So, in the root pom.xml I want to have a dependency from foo,
 > in module1’s pom I want to have a dependency from foo etc.

If you are making a multi module build you can always use 
${project.version} ...? Can you make an example project of what you have 
tried and put it on github or something similar that we have something 
concrete where we can talk about...

Kind regards
Karl Heinz Marbaise

 >
There seems to be no way to create a Maven property that matches foo’s 
version. If in the root pom I have:
>
> <properties>
>          <foo-version>${project.parent.version}</foo-version>
> </properties>
> 		
> This won’t work in module1/2’s pom as it will reference the root pom’s version,
not foo. The only thing that works is to hard code:
>
> <properties>
>          <foo-version>1.2</foo-version>
> </properties>
>
> But this means that I’m specifying foo’s version twice. Once in the parent tag and
once as a property. Is there no way around this?
>
> -Jordan
>


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


Mime
View raw message