MavenMetadataSource retrieves ResolutionGroup without consulting 
ManagedVersionMap, is problem when relocation
--------------------------------------------------------------------------------------------------------------

                 Key: MNG-3380
                 URL: http://jira.codehaus.org/browse/MNG-3380
             Project: Maven 2
          Issue Type: Bug
          Components: Dependencies
    Affects Versions: 2.0.8
            Reporter: luke w patterson
         Attachments: patch.txt, repo.zip

Consider the following scenario:

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>root-groupId</groupId>
  <artifactId>root-artifactId</artifactId>
  <version>1</version>
  <dependencies>
    <dependency>
      <groupId>direct-dependency-groupId</groupId>
      <artifactId>direct-dependency-artifactId</artifactId>
      <version>1</version>
    </dependency>
  </dependencies>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>transitive-dependency-new-groupId</groupId>
        <artifactId>transitive-dependency-artifactId</artifactId>
        <version>2</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
</project>

  <project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>direct-dependency-groupId</groupId>
    <artifactId>direct-dependency-artifactId</artifactId>
    <version>1</version>
    <dependencies>
      <dependency>
        <groupId>transitive-dependency-old-groupId</groupId>
        <artifactId>transitive-dependency-artifactId</artifactId>
        <version>1</version>
      </dependency>
    </dependencies>
  </project>       
       
    <project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>transitive-dependency-old-groupId</groupId>
      <artifactId>transitive-dependency-artifactId</artifactId>
      <version>1</version>
      <distributionManagement>
        <relocation>
          <groupId>transitive-dependency-new-groupId</groupId>
        </relocation>
      </distributionManagement>
    </project>       

    <project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>transitive-dependency-new-groupId</groupId>
      <artifactId>transitive-dependency-artifactId</artifactId>
      <version>1</version>
      <dependencies>
        <dependency>
          <groupId>other-groupId</groupId>
          <artifactId>other-artifactId-a</artifactId>
          <version>1</version>
        </dependency>
      </dependencies>
    </project>

    <project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>transitive-dependency-new-groupId</groupId>
      <artifactId>transitive-dependency-artifactId</artifactId>
      <version>2</version>
      <dependencies>
        <dependency>
          <groupId>other-groupId</groupId>
          <artifactId>other-artifactId-a</artifactId>
          <version>1</version>
        </dependency>
        <dependency>
          <groupId>other-groupId</groupId>
          <artifactId>other-artifactId-b</artifactId>
          <version>1</version>
        </dependency>
      </dependencies>
    </project>       
       
--------------------------------------------------------------        
actual dependency:tree 
    
 root-groupId:root-artifactId:jar:1
 \- direct-dependency-groupId:direct-dependency-artifactId:jar:1:compile
    \- 
transitive-dependency-new-groupId:transitive-dependency-artifactId:jar:2:compile
 (version managed from 1)
       \- other-groupId:other-artifactId-a:jar:1:compile           
-------------------------------------------------------------- 
expected dependency:tree 
    
 root-groupId:root-artifactId:jar:1
 \- direct-dependency-groupId:direct-dependency-artifactId:jar:1:compile
    \- 
transitive-dependency-new-groupId:transitive-dependency-artifactId:jar:2:compile
 (version managed from 1)
       \- other-groupId:other-artifactId-a:jar:1:compile    
       \- other-groupId:other-artifactId-b:jar:1:compile <-- missing from 
actual result    
-------------------------------------------------------------- 
 
As you can see from the listing above, 
other-groupId:other-artifactId-b:jar:1:compile is missing from the dependency 
list.  

I have attached the zipped repo which was used when generating the 
dependency:tree listings shown above.  I also attached a crude temporary patch 
which my team is currently using to resolve this issue.  After ignoring 
whitespace changes, it is about 10 lines different.


Thanks,

Luke

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to