最近我已經加入了Ban Transitive Dependencies plugin到我的pom.xml如下圖所示:'BanTransitiveDependencies失敗'背後的原因是什麼?
<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>
當我嘗試建立我的應用程序使用Maven,我會收到以下錯誤:
[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
我不是當然我明白這裏發生了什麼。爲什麼禁止傳遞依賴失敗?
通過我在的pom.xml以下依賴性方式:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
所以我應該改變hamcrest,所有的版本?還是應該將commons-lang 2.6添加到我的pom.xml中?
您能否解釋一下什麼是「禁止傳遞依賴」的正確方法?
順便說一句,你對org.hamcrest:hamcrest全:罐子: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/ –