2016-11-17 39 views
1

我有在两个包,其中一个在拉子的依赖是同一个包的比其他较低版本翻出一个Maven依赖关系的项目。该dependency:tree看起来是这样的:的Maven排除特定版本

Dependency convergence error for xerces:xercesImpl:2.10.0 paths to dependency are: 
+-com.vaadin:vaadin-client-compiler:7.6.4 
    +-net.sourceforge.nekohtml:nekohtml:1.9.19 
    +-xerces:xercesImpl:2.10.0 
and 
+-com.vaadin:vaadin-client-compiler:7.6.4 
    +-xerces:xercesImpl:2.11.0 

以上是从行家执法插件在那里我执行依赖版本收敛的输出。

有没有我可以指定一个版本,没有完全排除整个子依赖性排除的方法吗?

回答

3

声明net.sourceforge.nekohtml依赖在你的pom.xml作为第一依存度,并直接添加排除它。

参考:Maven Optional and Excludes

<dependency> 
    <groupId>net.sourceforge.nekohtml</groupId> 
    <artifactId>nekohtml</artifactId> 
    <version>1.9.19</version> 
    <exclusions> 
     <exclusion> 
     <groupId>xerces</groupId> 
     <artifactId>xercesImpl</artifactId> 
     </exclusion> 
    </exclusions> 
</dependency>