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

Inconsistent override behaivor with BOM vs dependency

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.5.0
    • None
    • Dependencies
    • None
    • osx jdk 1.8

    Description

      Consider we have 2 BOM files:
      bom1 - dependency version 1
      bom2 - dependency version 2'

      When a bom1 is imported into a parent and bom2 is imported into a child of parernt, child correctly overrides the dependency and uses "verision 2".

      When parent does not import bom1 but explicitly states "dependency 1" in the <dependencyManagement> section, and child imports bom2, "version 1" of dependency is used (bom2 in child does not override the dependency)

      This seems like inconsistent behavior as documentation explains that a BOM basically imports the <dependencyManagement> section of the bom into the current pom.

      If this is expected behavior it should be documented as we recently moved all our dependencyManagement section into a BOM for organizational reasons and it did not work as expected.

      Attached is a sample, to test simply extract and run:

      mvn install -f bom1/pom.xml
      mvn install -f bom2/pom.xml
      mvn dependency:tree -f project/child/pom.xml
      mvn dependency:tree -f project2/child/pom.xml

      project uses bom in parent and child and is overridden correctly.
      project2 parent uses dependency instead of bom, child uses bom but dependency is NOT overridden.

      Attachments

        1. mvn-bug.tar.gz
          2 kB
          Jay mann

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jmandawg Jay mann
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: