Maven
  1. Maven
  2. MNG-4768

Depending on declaration order, nearest matching version does not win when version range is involved in conflict

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1, 3.0-beta-2
    • Fix Version/s: 3.0-beta-3
    • Component/s: Dependencies
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Consider these two dirty trees that differ only by the order of direct dependencies:

      project
      +- a:1.0
      +- b:0.1
      |  \- c:0.1
      |     \- a:[2.0,3)
      \- d:0.1
         \- a:2.0
      
      project
      +- a:1.0
      +- d:0.1
      |  \- a:2.0
      \- b:0.1
         \- c:0.1
            \- a:[2.0,3)
      

      Further assume the repository contains version 1.0, 2.0 and 2.1 of a. Also note that each occurrence of a appears on a different tree depth.

      The first tree picks version 2.0, the latter 2.1 (from the range), although 2.0 is the nearer declaration (lower depth).

        Issue Links

          Activity

          Hide
          Benjamin Bentmann added a comment -

          And just for fun, the second dependency tree sketched above yields:

          [INFO] [dependency:tree {execution: default-cli}]
          [INFO] org.apache.maven.its.mng4768:adb:pom:0.1
          [INFO] +- org.apache.maven.its.mng4768:a:jar:2.0:compile
          [INFO] +- org.apache.maven.its.mng4768:d:jar:0.1:compile
          [INFO] \- org.apache.maven.its.mng4768:b:jar:0.1:compile
          [INFO]    \- org.apache.maven.its.mng4768:c:jar:0.1:compile
          

          i.e. the plugin output doesn't match up with the artifacts actually used by Maven for the classpath.

          Show
          Benjamin Bentmann added a comment - And just for fun, the second dependency tree sketched above yields: [INFO] [dependency:tree {execution: default-cli}] [INFO] org.apache.maven.its.mng4768:adb:pom:0.1 [INFO] +- org.apache.maven.its.mng4768:a:jar:2.0:compile [INFO] +- org.apache.maven.its.mng4768:d:jar:0.1:compile [INFO] \- org.apache.maven.its.mng4768:b:jar:0.1:compile [INFO] \- org.apache.maven.its.mng4768:c:jar:0.1:compile i.e. the plugin output doesn't match up with the artifacts actually used by Maven for the classpath.
          Hide
          Benjamin Bentmann added a comment -

          Fixed by r988749.

          Show
          Benjamin Bentmann added a comment - Fixed by r988749 .

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Benjamin Bentmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: