maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <jor...@jordanzimmerman.com>
Subject Reactor projects and ${project.version}
Date Tue, 15 Sep 2015 23:50:07 GMT
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. 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
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message