博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

dependencyManagement

Posted on 2016-06-01 16:28  钟悍  阅读(246)  评论(0编辑  收藏  举报

The maven way of resolving situations like this is to include a section in your project's root pom, where you specify which version of which library will be used.

<dependencyManagement>
  <dependencies>
    <dependency>
        <groupId>foo</groupId>
        <artifactId>bar</artifactId>
        <version>1.2.3</version>
    </dependency>
   </dependencies>
</dependencyManagement>

 

Now no matter which version of library foo:bar is requested by a dependency, version 1.2.3 will always be used for this project and all sub-projects.

 

 

mvn dependency:tree -Dverbose
mvn dependency:tree -Dverbose | grep 'omitted for conflict'