Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-2931

DefaultArtifactCollector changes the version of the originatingArtifact if it's in the dependencyManagement with another version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.0.5, 2.0.6
    • None
    • None

    Description

      DefaultDependencyTreeBuilder
      https://svn.apache.org/repos/asf/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/tree/DefaultDependencyTreeBuilder.java

      calls collect like this

      collector.collect( project.getDependencyArtifacts(), project.getArtifact(), managedVersions, repository,
      project.getRemoteArtifactRepositories(), metadataSource, null,
      Collections.singletonList( listener ) );

      Problem:
      This pom
      http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-component-api/1.0-alpha-22/plexus-component-api-1.0-alpha-22.pom
      extends
      http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-containers/1.0-alpha-22/plexus-containers-1.0-alpha-22.pom
      that in dependencyManagement has org.codehaus.plexus:plexus-component-api:1.0-alpha-19

      so during collect project.getArtifact().getVersion() is changed to the managedVersion instead of the original one

      Either this is a bug or an exception should be thrown when originatingArtifact is in managedVersions

      Attachments

        1. MNG-2931.patch
          1 kB
          Carlos Sanchez Gonzalez

        Issue Links

          Activity

            People

              Unassigned Unassigned
              carlos Carlos Sanchez Gonzalez
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: