Let's say I have a maven parent POM root
which defines foo:bar:1.0.0
in dependency management. I have another parent POM parent
which uses root
as parent (just to add another layer to the example). Lastly I have a bill of materials bom
which uses root
as its parent but redefines foo:bar:2.0.0
in its dependency management.
In my project app
I inherit from parent
and then I import the BOM in the dependency management section of app
root (foo:bar:1.0.0) <- parent <- app+bom
^
|
bom (foo:bar:2.0.0)
Which dependency management section wins? Which version of foo:bar
do I get?
I know that if I were to directly include foo:bar
in the dependency management section of app
, it would override that inherited from the parent. But is importing a BOM in the dependency management section equivalent to directly including it in the dependency management section, and sufficient to override that of the parent? Or does the inherited foo:bar
from the parent's dependency management take precedence?
mvn dependency:tree
ormvn help:effective-pom
. – Beulabeulah