下図のように最近、私は私のpom.xmlにBan Transitive Dependencies pluginを追加しました:私はMavenのと私のアプリケーションを構築しようとすると'BanTransitiveDependencies failed'の背後にある理由は何ですか?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<banTransitiveDependencies>
<excludes>
<!-- the rule will not fail even if it detects ignoredArtifact
of group org.apache.maven, because it is excluded -->
</excludes>
<includes>
</includes>
</banTransitiveDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>
、私は次のエラーを取得します:
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BanTransitiveDependencies failed with message:
org.hamcrest:hamcrest-all:jar:1.2:test has transitive dependencies:
commons-lang:commons-lang:jar:2.6:test
を私はないです確かに私はここで何が起こっているのか理解している。なぜ推移的な依存関係が失敗するのですか?だから私はhamcrest-すべてのバージョンを変更することが出来るのです
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
:私はのpom.xmlに以下の依存関係を持っているところで
?またはpomm.xmlにもcommons-lang 2.6を追加する必要がありますか?
「過渡的な依存関係を禁止する」正しい方法は何ですか?
はところで、あなたについてorg.hamcrestです:hamcrest-全てます。jar:1.2?バージョン1.2は利用できません(http://mvnrepository.com/artifact/org)。hamcrest/hamcrest-all)明らかに –
@ A.DiMatteo http://repository.ow2.org/nexus/content/repositories/ow2-legacy/org/hamcrest/hamcrest-all/1.2/ –