maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schulte>
Subject Re: dependencyManagement BOM question
Date Tue, 23 Aug 2016 20:06:38 GMT
Am 08/23/16 um 21:27 schrieb David Hoffer:
> I have some questions regarding how importing a pom type dependency in my
> dependencyManagement section really works (e.g. BOM dependency).  At a
> basic level I understand it will effectively add all its dependencies
> defined in its dependencyManagement section to my dependencyManagement
> section.

Not all. Only the dependencies not already declared in your effective
dependency management. Implemented in class


based on method 'getManagementKey' of class


> However the imported pom uses variables for all the versions and defines
> them in its pom.  Now if I want to use a different version and also have
> the version variable (same variable name) set in my pom, which version will
> be used?

Maven imports the effective dependency management of the BOM (after
inheritance, interpolation, etc.). Consider the BOM a standalone project
without any relationship to the importing POM.

> What about order of the BOM import?  Does the order of the BOM import
> matter with respect to other non imported dependencyManagement
> dependencies?  If my POM has the same dependency of the imported one which
> one will be used?  Lets say in one case I'm using a property variable to
> specify the version and also if I use a literal version.

Effective dependencies of the POM override what gets imported. See
above. When using multiple BOM imports in the POM, the order of
declaration of those imports matter (after inheritance, interpolation,
etc.). As of Maven 3.4.0-SNAPSHOT you'll get a warning when your POM
depends on this "first declaration wins" itch. Relying on the order of
XML elements should be avoided.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message