2016-11-17 729 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>