Dependency与DependencyManagement的区别

来源:互联网 发布:涉密网络分级保护 编辑:程序博客网 时间:2024/06/05 04:57

Dependency

<dependency>为project引入依赖

DependencyManagement

<dependencyManagement>是为project下的所有module个共同依赖,提供了一个统一的<version>声明的途径,用以保证所有module的依赖版本一致性。当parentmodule中声明的版本号发生冲突时,优先依赖parent中<dependencyManagement>声明的版本号。<dependencyManagement>不真正引入依赖

注意, <dependencyManagement>的结构是:

<dependencyManagement>    <dependencies>        <dependency>...</dependency>    </dependencies></dependencyManagement>

<dependencies>不能少。

0 0