Stephen, 

> -----Original Message-----
> From: Stephen Connolly [mailto:[EMAIL PROTECTED] 
> Sent: woensdag 10 december 2008 14:01
> To: Maven Developers List
> Subject: Re: Version property in root POM & multi-level 
> dependency resolution
> 
> I'm not sure where you see the run-time error?  In Maven in 
> general or in the versions-maven-plugin?

Maven in general.

> Which code are you browsing?  Maven or versions-maven-plugin?

Maven codebase.

Coming back to my current setup:

All projects have as their own version 9.10-SNAPSHOT, and I build and deploy 
snapshot versions:

pres.d:9.10-SNAPSHOT
srv.a:9.10-SNAPSHOT
common:9.10-SNAPSHOT

In the POM of pres.d, I have the dependency on srv.a defined as 
srv.a:${ver-release} and the property ver-release is defined as [9.10,9.11). In 
the POM of srv.a, I have the dependency on common defined as 
common:${ver-release} and the property ver-release is defined as [9.10,9.11)
As you can see, I use the same property to specify the version of the 
dependencies of my own modules.

When I make a release of a module using the maven-release-plugin, I specify the 
options to generate a release-pom.xml and the releaseVersion and 
developmentVersion properties, e.g. in module pres.d:

mvn release:prepare -DgenerateReleasePoms=true -DreleaseVersion=9.10.3 
-DdevelopmentVersion=9.10-SNAPSHOT

This makes release pres.d:9.10.3, with the release-pom.xml pointing to the last 
released version of srv.a at the time the release is created. In the regular 
POM file, the version range is kept. So far so good.

Now for a developer setup, I want to override the version range *without 
altering my POMs whatsoever*! I create an active profile in my settings.xml and 
redefine the property ver-release with value 9.10-SNAPSHOT. If I do an mvn 
dependency:resolve in pres.d, I read:

[INFO] The following files have been resolved:
[INFO] be.telenet.test:common:jar:9.10.4:compile
[INFO] be.telenet.test:srv.a:jar:9.10-SNAPSHOT:compile

Maven correctly used the overriden value of ver-release to resolve the 
dependency from pres.d on srv.a, but when resolving the version of srv.a on 
common, my overridden value was ignored and the version range was used. 
Currently, common:9.10.4 is the last released version. I don't find this 
consistent behaviour. I would like to have common:9.10-SNAPSHOT isnstead.

I found the ModelInterpolator in the code base where properties are replaced 
with their actual value. At the time of writing, I try to find it the 
interpolator is also used during the transitive dependency resolution step.

Ringo
*************************************************************

Dit e-mail bericht inclusief eventuele ingesloten bestanden kan informatie 
bevatten die vertrouwelijk is en/of beschermd door intellectuele 
eigendomsrechten. Dit bericht is uitsluitend bestemd voor de geadresseerde(n). 
Elk gebruik van de informatie vervat in dit bericht (waaronder de volledige of 
gedeeltelijke reproductie of verspreiding onder elke vorm) door andere personen 
dan de geadresseerde(n) is verboden. Indien u dit bericht per vergissing heeft 
ontvangen, gelieve de afzender hiervan te verwittigen en dit bericht te 
verwijderen. 

This e-mail and any attachment thereto may contain information which is 
confidential and/or protected by intellectual property rights and are intended 
for the sole use of the addressees. Any use of the information contained herein 
(including but not limited to total or partial reproduction or distribution in 
any form) by other persons than the addressees is prohibited. If you have 
received this e-mail in error, please notify the sender and delete its contents.

Ce courriel et les annexes éventuelles peuvent contenir des informations 
confidentielles et/ou protégées par des droits de propriété intellectuelle. Ce 
message est adressé exclusivement à son (ses) destinataire(s). Toute 
utilisation du contenu de ce message (y compris la reproduction ou diffusion 
partielle ou complète sous toute forme) par une autre personne que le(s) 
destinataire(s) est formellement interdite. Si vous avez reçu ce message par 
erreur, veuillez prévenir l'expéditeur du message et en détruire le contenu.

*************************************************************

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

Reply via email to