- 方式一,通过在父模块中声明
<dependencyManagement />
和<pluginManagement />
,然后让子模块通过元素指定父模块,这样子模块在定义依赖是就可以只定义groupId
和artifactId
,自动使用父模块的version
,这样统整个项目的依赖的版本。
继承的方式。 - 方式二,使用
<dependencie />
声明<scope />
为的依赖,从而引入一个pom的import<dependencyManagement />
的。
<dependencyManagement />
和<pluginManagement />
,然后让子模块通过元素指定父模块,这样子模块在定义依赖是就可以只定义groupId
和 artifactId
,自动使用父模块的 version
,这样统整个项目的依赖的版本。<dependencie />
声明<scope />
为的依赖,从而引入一个pom的import<dependencyManagement />
的。