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

[regression] Cycle between transitive dependencies causes bad effective dependency scope

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.2
    • Fix Version/s: 3.0.3
    • Component/s: Dependencies
    • Labels:
      None
    • Environment:

      Description

      I'm getting different transitive dependency scope resolution when building with Maven 3. Transitive dependencies from a provided scope should be resolved to provided according to the docs, but it is resolving to compile as shown below. When building with Maven 2 it works correctly.

      I tried to isolate the problem with a simpler scenario, but could only reproduce using the org.apache.xmlgraphics:fop:jar:1.0 dependency.

      Maven 3 dependency output snippet:

      [DEBUG] test:a:jar:1
      [DEBUG]    test:a-deps:pom:1:provided
      [DEBUG]       org.apache.xmlgraphics:fop:jar:1.0:provided
      [DEBUG]          org.apache.xmlgraphics:xmlgraphics-commons:jar:1.4:provided
      [DEBUG]          org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile
      [DEBUG]             org.apache.xmlgraphics:batik-anim:jar:1.7:compile
      [DEBUG]             org.apache.xmlgraphics:batik-css:jar:1.7:compile
      [DEBUG]             org.apache.xmlgraphics:batik-dom:jar:1.7:compile
      [DEBUG]             org.apache.xmlgraphics:batik-parser:jar:1.7:compile
      [DEBUG]             org.apache.xmlgraphics:batik-util:jar:1.7:compile
      [DEBUG]             xml-apis:xml-apis:jar:1.3.04:compile
      [DEBUG]             xml-apis:xml-apis-ext:jar:1.3.04:compile
      [DEBUG]          org.apache.xmlgraphics:batik-bridge:jar:1.7:provided
      [DEBUG]             org.apache.xmlgraphics:batik-script:jar:1.7:provided
      [DEBUG]                org.apache.xmlgraphics:batik-js:jar:1.7:provided
      [DEBUG]             org.apache.xmlgraphics:batik-xml:jar:1.7:compile
      [DEBUG]             xalan:xalan:jar:2.6.0:compile
      [DEBUG]          org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile
      [DEBUG]          org.apache.xmlgraphics:batik-gvt:jar:1.7:provided
      [DEBUG]          org.apache.xmlgraphics:batik-transcoder:jar:1.7:provided
      [DEBUG]             org.apache.xmlgraphics:batik-svggen:jar:1.7:provided
      [DEBUG]          org.apache.xmlgraphics:batik-extension:jar:1.7:provided
      [DEBUG]          org.apache.xmlgraphics:batik-ext:jar:1.7:compile
      [DEBUG]          commons-logging:commons-logging:jar:1.0.4:provided
      [DEBUG]          commons-io:commons-io:jar:1.3.1:provided
      [DEBUG]          org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:provided
      [DEBUG]          org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:provided
      

      Maven 2 dependency output:

      [DEBUG] test:a:jar:1 (selected for null)
      [DEBUG]   test:a-deps:pom:1:provided (selected for provided)
      [DEBUG]     org.apache.xmlgraphics:fop:jar:1.0:provided (selected for provided)
      [DEBUG]       org.apache.xmlgraphics:xmlgraphics-commons:jar:1.4:provided (selected for provided)
      [DEBUG]         commons-io:commons-io:jar:1.3.1:provided (selected for provided)
      [DEBUG]         commons-logging:commons-logging:jar:1.0.4:provided (selected for provided)
      [DEBUG]       org.apache.xmlgraphics:batik-svg-dom:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-svg-dom:jar:1.7:provided (removed - causes a cycle in the graph)
      [DEBUG]         org.apache.xmlgraphics:batik-anim:jar:1.7:provided (selected for provided)
      [DEBUG]           org.apache.xmlgraphics:batik-awt-util:jar:1.7:provided (selected for provided)
      [DEBUG]             org.apache.xmlgraphics:batik-util:jar:1.7:provided (selected for provided)
      [DEBUG]           org.apache.xmlgraphics:batik-dom:jar:1.7:provided (selected for provided)
      [DEBUG]             org.apache.xmlgraphics:batik-css:jar:1.7:provided (selected for provided)
      [DEBUG]               org.apache.xmlgraphics:batik-ext:jar:1.7:provided (selected for provided)
      [DEBUG]                 xml-apis:xml-apis:jar:1.3.04:provided (selected for provided)
      [DEBUG]               xml-apis:xml-apis:jar:1.3.04:provided (selected for provided)
      [DEBUG]               xml-apis:xml-apis-ext:jar:1.3.04:provided (selected for provided)
      [DEBUG]             org.apache.xmlgraphics:batik-ext:jar:1.7:provided (selected for provided)
      [DEBUG]             org.apache.xmlgraphics:batik-xml:jar:1.7:provided (selected for provided)
      [DEBUG]             xalan:xalan:jar:2.6.0:provided (selected for provided)
      [DEBUG] While downloading xml-apis:xml-apis:2.0.2
        This artifact has been relocated to xml-apis:xml-apis:1.0.b2.
      
      
      [DEBUG]               xml-apis:xml-apis:jar:1.0.b2:provided (removed - nearer found: 1.3.04)
      [DEBUG]             xml-apis:xml-apis:jar:1.3.04:provided (selected for provided)
      [DEBUG]             xml-apis:xml-apis-ext:jar:1.3.04:provided (selected for provided)
      [DEBUG]           org.apache.xmlgraphics:batik-ext:jar:1.7:provided (selected for provided)
      [DEBUG]           org.apache.xmlgraphics:batik-parser:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-awt-util:jar:1.7:provided (selected for provided)
      [DEBUG]           org.apache.xmlgraphics:batik-util:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-css:jar:1.7:provided (selected for provided)
      [DEBUG]           xml-apis:xml-apis:jar:1.3.04:provided (selected for provided)
      [DEBUG]           xml-apis:xml-apis-ext:jar:1.3.04:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-dom:jar:1.7:provided (selected for provided)
      [DEBUG]           org.apache.xmlgraphics:batik-xml:jar:1.7:provided (selected for provided)
      [DEBUG]           xalan:xalan:jar:2.6.0:provided (selected for provided)
      [DEBUG] While downloading xml-apis:xml-apis:2.0.2
        This artifact has been relocated to xml-apis:xml-apis:1.0.b2.
      
      
      [DEBUG]             xml-apis:xml-apis:jar:1.0.b2:provided (removed - nearer found: 1.3.04)
      [DEBUG]         org.apache.xmlgraphics:batik-ext:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-parser:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-util:jar:1.7:provided (selected for provided)
      [DEBUG]         xml-apis:xml-apis:jar:1.3.04:provided (selected for provided)
      [DEBUG]         xml-apis:xml-apis-ext:jar:1.3.04:provided (selected for provided)
      [DEBUG]       org.apache.xmlgraphics:batik-bridge:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-bridge:jar:1.7:provided (removed - causes a cycle in the graph)
      [DEBUG]         org.apache.xmlgraphics:batik-gvt:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-bridge:jar:1.7:provided (removed - causes a cycle in the graph)
      [DEBUG]         org.apache.xmlgraphics:batik-script:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-xml:jar:1.7:provided (selected for provided)
      [DEBUG]         xalan:xalan:jar:2.6.0:provided (selected for provided)
      [DEBUG] While downloading xml-apis:xml-apis:2.0.2
        This artifact has been relocated to xml-apis:xml-apis:1.0.b2.
      
      
      [DEBUG]           xml-apis:xml-apis:jar:1.0.b2:provided (removed - nearer found: 1.3.04)
      [DEBUG]       org.apache.xmlgraphics:batik-awt-util:jar:1.7:provided (selected for provided)
      [DEBUG]       org.apache.xmlgraphics:batik-gvt:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-gvt:jar:1.7:provided (removed - causes a cycle in the graph)
      [DEBUG]       org.apache.xmlgraphics:batik-transcoder:jar:1.7:provided (selected for provided)
      [DEBUG]         org.apache.xmlgraphics:batik-svggen:jar:1.7:provided (selected for provided)
      [DEBUG]       org.apache.xmlgraphics:batik-extension:jar:1.7:provided (selected for provided)
      [DEBUG]       org.apache.xmlgraphics:batik-ext:jar:1.7:provided (selected for provided)
      [DEBUG]       commons-logging:commons-logging:jar:1.0.4:provided (selected for provided)
      [DEBUG]       commons-io:commons-io:jar:1.3.1:provided (selected for provided)
      [DEBUG] Retrieving parent-POM: org.apache.avalon:avalon-framework:pom:1 for project: org.apache.avalon.framework:avalon-framework-api:jar:4.3.1 from the repository.
      [DEBUG] Retrieving parent-POM: org.apache.excalibur:excalibur:pom:1 for project: org.apache.avalon:avalon-framework:pom:1 from the repository.
      [DEBUG]       org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:provided (selected for provided)
      [DEBUG]       org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:provided (selected for provided)
      

      I'm attaching a sample project that allows to reproduce the problem and logs.
      I've run: mvn -X clean package

        Attachments

        1. test-projects.zip
          22 kB
          Renato Garcia

          Issue Links

            Activity

              People

              • Assignee:
                bentmann Benjamin Bentmann
                Reporter:
                rgarcia Renato Garcia
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: