You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christian Schulte (JIRA)" <ji...@apache.org> on 2018/01/29 10:25:00 UTC

[jira] [Closed] (MNG-6246) Inconsistent override behaivor with BOM vs dependency

     [ https://issues.apache.org/jira/browse/MNG-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schulte closed MNG-6246.
----------------------------------
    Resolution: Duplicate

> Inconsistent override behaivor with BOM vs dependency
> -----------------------------------------------------
>
>                 Key: MNG-6246
>                 URL: https://issues.apache.org/jira/browse/MNG-6246
>             Project: Maven
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.5.0
>         Environment: osx jdk 1.8
>            Reporter: Jay mann
>            Priority: Major
>         Attachments: mvn-bug.tar.gz
>
>
> 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. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)