当使用了传递依赖,也就是使用了没有显示声明的依赖时,如果继承的<dependencyManagement/>中声明了使用的传递依赖的版本,那么最终使用的依赖是<dependencyManagement/>中声明的版本。
用Spring举一个栗子:
1.mvn dependency:tree
先看下项目依赖的基础组件使用的Spring版本。

可以看到基础组件使用的Spring版本为3.1.3,不能lambda表达式(被坑过)。
2.mvn dependency:analyze
接下来分析下依赖,关注Spring的相关依赖。

可以看到Spring作为传递依赖使用,版本是基础组件使用的版本3.1.3。
3.parent module
然后在项目的parent module的<dependencyManagement/>加入一个spring-framework-bom来管理Spring的版本。

${springframework.version}为5.0.4.RELEASE
4.重新执行mvn dependency:tree

可以看到Spring的版本变为了5.0.4.RELEASE。

在执行mvn dependency:analyze后看到使用的Spring版本也变成了5.0.4.RELEASE。
5.文档
- Dependency management - this allows project authors to directly specify the versions of artifacts to be used when they are encountered in transitive dependencies or in dependencies where no version has been specified. In the example in the preceding section a dependency was directly added to A even though it is not directly used by A. Instead, A can include D as a dependency in its dependencyManagement section and directly control which version of D is used when, or if, it is ever referenced.