Sven,

I did some thing like you are describing.  We used one version number for 30
or so modules.   We ran maven like this:

  mvn install -DbuildVersion=1.1-DEVELOPERNAME-SNAPSHOT

Then in the poms...

    <dependency>
        <groupId>my.group.id</groupId>
        <artifactId>test-program</artifactId>
        <version>${buildVersion}</version>
    </dependency> 

We had to hard code the parent version, couldn't get it to work with a
variable, but everything else worked fine.

David



Sven Vlieghe wrote:
> 
> Hi there,
> 
> I am trying to centralize the version-numbers of all projects/dependencies
> in our system. My approach for this, is to centralize the
> settings.xml-file & add all versions as profile-properties. This worked
> perfectly at first sight, but resulted in errors when trying to use the
> project as a dependency.
> 
> 
> Example settings.xml:
> <settings>
> ...
>       <profiles>
>               <profile>
>                       <id>my-active-profile</id>
>                       <properties>
>                               <version.test>2.2.0</version.test>
>                       </properties>
>               </profile>
>       </profiles>
>       <activeProfiles>
>               <activeProfile>my-active-profile</activeProfile>
>       </activeProfiles>
> </settings>
> 
> 
> Example project pom.xml:
> <project>
>       <artifactId>some-project</artifactId>
> ...
>       <dependencies>
>               <!-- project dependencies -->
>               <dependency>
>                       <groupId>my.group.id</groupId>
>                       <artifactId>test-program</artifactId>
>                       <version>${version.test}</version>
>               </dependency>
>       </dependencies>
> </project>
> 
> 
> When trying to build 'some-project', maven is capable of resolving
> ${version.test} into the correct version. No problems here.
> 
> 
> However, when adding 'some-project' as a dependency of an other project:
> <project>
>       <artifactId>some-other-project</artifactId>
> ...
>       <dependencies>
>               <!-- project dependencies -->
>               <dependency>
>                       <groupId>my.group.id</groupId>
>                       <artifactId>some-project</artifactId>
>               </dependency>
>       </dependencies>
> </project>
> 
> This build fails.. maven doesn't resolve the properties in 'some-project'
> (in this case, version.test) & therefore tries to find
> my.group.id:test-program:${version.test} instead of
> my.group.id:test-program:2.2.0
> 
> 
> Anyone sees what I'm doing wrong?
> 
> thanks in advance,
> 
> Sven
> 

-- 
View this message in context: 
http://www.nabble.com/Resolving-dependency-properties-tp19162134p19180112.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to