2016-11-17 4 views
1

私は、2つのパッケージを取り込むmaven依存関係を持つプロジェクトを持っています。そのうちの1つは、他のものよりも低いバージョンの同じパッケージであるサブ依存関係を取得します。 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 

私は依存関係のバージョンの収束を強制していますMavenのEnforcerプラグインからの出力です。

サブ依存関係全体を除外せずに除外するバージョンを指定できる方法はありますか?

答えて

3

pom.xmlのnet.sourceforge.nekohtml依存関係を一次依存関係として宣言し、それに直接除外を追加します。

参考: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> 
関連する問題