[英]Make maven-enforcer-plugin dependency convergence rule ignore minor version of artifact
I want to introduce maven-enforcer-plugin
in my maven project but don't want to compare the bug fix versions while evaluating the rules.我想在我的 maven 项目中引入maven-enforcer-plugin
,但不想在评估规则时比较错误修复版本。
Ex.: groupId-artifactId-XYA
and groupId-artifactId-XYB
should not be treated as rule failure.例如: groupId-artifactId-XYA
和groupId-artifactId-XYB
不应被视为规则失败。
The current plugin configuration looks like following当前插件配置如下所示
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>1.8</version>
</requireJavaVersion>
<banDuplicatePomDependencyVersions/>
<dependencyConvergence/>
</rules>
</configuration>
</execution>
</executions>
</plugin>
If an artifact, let's say aws-java-sdk
is being pulled in as transitive dependency from two different directly listed dependencies, the plugin should NOT raise an error if the versions of aws-java-sdk
only differ for minor version like 1.21.667
and 1.21.700
.如果一个工件,假设aws-java-sdk
作为传递依赖从两个不同的直接列出的依赖项中提取,则如果aws-java-sdk
的版本仅与1.21.667
等次要版本不同,则插件不应引发错误和1.21.700
。 It should only raise an error if feature/major versions are different like 1.21.667
and 1.17.111
如果功能/主要版本不同,如1.21.667
和1.17.111
,它应该只引发错误
That is not possible with the current rule.这在现行规则下是不可能的。
You need to write your own enforcer rule for that.您需要为此编写自己的实施者规则。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.