Maven
  1. Maven
  2. MNG-1577

dependencyManagement does not work for transitive dependencies

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.6
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      11

      Description

      The dependencyManagement does not work for transient dependencies. The specified version is ignored.

      Use case:
      Main POM defines commons-digester-1.6 and commons-beanutils-1.7.0, A-SNAPSHOT and B-SNAPSHOT
      Project A is child of Main and depends directly on commons-beanutils (version inherited from Main)
      Project B is child of Main and depends directly on commons-digester (version inherited from Main)
      Project C is child of Main and depends directly on A & B (versions inherited from Main)

      A is compiled and tests are run using commons-beanutils-1.7.0
      B is compiled and tests are run using commons-digester-1.6 and commons-beanutils-1.6, since digester is dependend on this
      C is compiled and tests are run using commons-beanutils-1.7.0

      Integration tests of B did not verify, that B is behaving as expected in this scenario. B might fail with 1.7.0 and it is not even recognized.

      If I add beanutils also as direct dependency to B, it works fine, but then are transitive dependency useless. It should be possible to define at least in the dependencyManagement, that the versions of transient dependencies also defined in the dependencyManagement have priority.

      • Jörg
      1. mng1577.patch
        15 kB
        Ralph Goers
      2. mng1577a.patch
        15 kB
      3. mng1577b.patch
        35 kB
        Ralph Goers
      4. mng1577c.patch
        36 kB
        Ralph Goers
      5. mng1577d.patch
        74 kB
        Ralph Goers
      6. mng1577e.patch
        75 kB
        Ralph Goers
      7. mng1577e-trunk.patch
        85 kB
        Ralph Goers
      8. mng1577f.patch
        107 kB
        Patrick Schneider
      9. mng1577trunk.patch
        45 kB
        Ralph Goers
      10. MNG-1577-trunk-final.patch
        131 kB
        Patrick Schneider
      11. site.patch
        6 kB
        Ralph Goers

        Issue Links

          Activity

          Hide
          Patrick Schneider added a comment -

          Here is an updated version of mng1577e.patch for the 2.0.x branch. It addresses not being able to bootstrap once the patch has been applied. (Some inheritance tests, added by the patch, were not finding their dependency jars.)

          Show
          Patrick Schneider added a comment - Here is an updated version of mng1577e.patch for the 2.0.x branch. It addresses not being able to bootstrap once the patch has been applied. (Some inheritance tests, added by the patch, were not finding their dependency jars.)
          Hide
          Ralph Goers added a comment -

          Patch to the maven web site to document the new behavior.

          Show
          Ralph Goers added a comment - Patch to the maven web site to document the new behavior.
          Hide
          Jason van Zyl added a comment -

          Patch applied, thanks Ralph.

          Show
          Jason van Zyl added a comment - Patch applied, thanks Ralph.
          Hide
          Patrick Schneider added a comment -

          This is the 1577 2.0.x patch ported so it will cleanly apply to the trunk @ rev 520633. Unit tests had to be refactored such that artifact names are unique. Verified that transitive deps are resolved correctly using the same small smoke tests and one large build that were tested for the the 2.0.x patch.

          Show
          Patrick Schneider added a comment - This is the 1577 2.0.x patch ported so it will cleanly apply to the trunk @ rev 520633. Unit tests had to be refactored such that artifact names are unique. Verified that transitive deps are resolved correctly using the same small smoke tests and one large build that were tested for the the 2.0.x patch.
          Hide
          Jason van Zyl added a comment -

          Thanks, patch applied on trunk.

          Show
          Jason van Zyl added a comment - Thanks, patch applied on trunk.

            People

            • Assignee:
              Jason van Zyl
              Reporter:
              Jörg Schaible
            • Votes:
              38 Vote for this issue
              Watchers:
              34 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: