maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject RE: aggregate project and dependency versions in a single property
Date Wed, 06 Sep 2006 08:49:46 GMT
Hi Alexis,

Alexis Midon wrote on Wednesday, September 06, 2006 10:36 AM:

> Hi all,
> I've got a classical multi module project with pom
> inheritance and inter
> modules dependencies.
> However my modules are always released together and thus have the
> same version. Moreover the whole project is always checkout and the
> <relativePath> tags are correctly set.
> As a result what I'd like to do is set the version in a
> single place. Of
> course the parent pom seems to be the relevant place.
> Let's create a property named <my.version>1.0</my.version>
> and use it in the
> <version> tag of the pom and in the <parent> tag og the child pom.
> Call this property in the <dependency> tag too.
> An example project is attached:
> test0\pom.xml
> test0\test1\pom.xml         [jar]
> test0\test2\pom.xml         [jar] depends on test 1
> test0\sub\pom.xml           [pom]
> test0\sub\test3\pom.xml   [jar] depends on test 1
> So far, you can successfully test any goal on the root pom.
> Now what is really weird is that:
> After installing test1-1.0.jar , a compile goal (for example)
> on test2 fails
> because Maven cannot resolve test1-${my.version}!
> Everything looks like the ${my.version} property is not set.
> To understand what was going on I ran "mvn
> help:effective-pom" on test2 and
> the result is really surprising: the property is correctly set!
> I get:
>     <dependency>
>       <groupId>com.foobar</groupId>
>       <artifactId>test1</artifactId>
>       <version>1.0</version> <!-- instead of ${ my.version} -->   

> </dependency> 
> Do you have any explanations?
> Thanks in advance for your help!

Look into your local repo. I am quite sure, that the installed pom still has the inresolved
property and this one cannot be resolved anymore ...

- Jörg

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message