最近我已经加入了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/ –