Brett, 

> -----Original Message-----
> From: Brett Porter 
> 
> Ok, I see what you mean. You illustrated the property in the 
> project which should not work. But from settings.xml and the 
> command line it should.

Unfortunately, it doesn't, or again I'm misinterpreting you. :-)

The three attached files represent a simplification of our project
setup, with c -> b -> a
I removed all usage of profiles in this example, using command line
properties as you suggested.

* Project a does not have any dependencies, so I installed the snapshot
version in my local repository via 'mvn install'
* Project b has a dependency on project a, so I installed the snapshot
version in my local repository via 'mvn -Dver-modules=1.0-SNAPSHOT
install' to bypass the fact that I do not have any released version of
project a, matching the specified range.
* Project c has a dependency on project b, and transitively on a. By
overriding the property ver-modules, used in the poms of b and c, I
would like to get to the setup 
c:1.-SNAPSHOT -> b:1.0-SNAPSHOT -> a:1.0-SNAPSHOT
and not
c:1.-SNAPSHOT -> b:1.0-SNAPSHOT -> a:[1.0,1.1)

I tried 'mvn -Dver-modules=1.0-SNAPSHOT dependency:resolve' for project
c, but I get this as output:

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO]
------------------------------------------------------------------------
[INFO] Building Project C using B
[INFO]    task-segment: [dependency:resolve]
[INFO]
------------------------------------------------------------------------
[INFO] snapshot be.atriso.test:b:1.0-SNAPSHOT: checking for updates from
telenet.nexus-snapshots
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Couldn't find a version in [1.0-SNAPSHOT] to match range [1.0,1.1)
  be.atriso.test:a:pom:null

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  telenet.nexus-snapshots (<internal URL>),
  telenet.nexus (<internal URL>)

If I patch my local repository to simulate a released version of a:1.0,
then I get this as output:

[INFO] The following files have been resolved:
[INFO]    be.atriso.test:a:pom:1.0:compile
[INFO]    be.atriso.test:b:pom:1.0-SNAPSHOT:compile

Still not what I want... :-)

As a concluding note, I want to highlight that I'm using a patched Maven
2.0.9 distribution in which bug MNG-3092 is fixed using the patch file
attached to the JIRA issue.
http://jira.codehaus.org/browse/MNG-3092

> try removing the type :)

Good catch! :-)

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.

*************************************************************
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>be.atriso.test</groupId>
  <artifactId>a</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Project A</name>

</project>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>be.atriso.test</groupId>
  <artifactId>b</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Project B using A</name>

  <properties>
    <ver-modules>[1.0,1.1)</ver-modules>
  </properties>

  <dependencies>
    <dependency>
      <groupId>be.atriso.test</groupId>
      <artifactId>a</artifactId>
      <version>${ver-modules}</version>
      <type>pom</type>
    </dependency>
  </dependencies>

</project>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>be.atriso.test</groupId>
  <artifactId>c</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Project C using B</name>

  <properties>
    <ver-modules>[1.0,1.1)</ver-modules>
  </properties>

  <dependencies>
    <dependency>
      <groupId>be.atriso.test</groupId>
      <artifactId>b</artifactId>
      <version>${ver-modules}</version>
      <type>pom</type>
    </dependency>
  </dependencies>

</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to