简体   繁体   English

使 maven-enforcer-plugin 依赖收敛规则忽略次要版本的工件

[英]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-XYAgroupId-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.6671.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.

相关问题 使用Maven-Enforcer-Plug解决依赖项收敛错误的策略 - Strategy for resolving dependency convergence errors with maven-enforcer-plugin maven-enforcer-plugin引起的依赖性收敛错误 - Dependency convergence error caused by maven-enforcer-plugin 如何在maven-enforcer-plugin的当前pom.xml中获取依赖项的版本? - How can I get a dependency's version in the current pom.xml for maven-enforcer-plugin? maven-enforcer-plugin-在Maven中配置的位置 - maven-enforcer-plugin - where to configure in Maven maven-enforcer-plugin和child pom - maven-enforcer-plugin and child pom 无法执行Maven-Enforcer-Plug - Failed to execute maven-enforcer-plugin 使用maven执行器插件时如何解决“依赖收敛错误”? - How to resolve "Dependency convergence error" when using maven enforcer plugin? 如何配置maven-enforcer-plugin以排除测试范围中的某些规则? - How to confiugure maven-enforcer-plugin to exclude some rule in test scope? 使用 YAML 配置 Maven - maven-enforcer-plugin 特定 - 不起作用 - Configuring Maven with YAML - maven-enforcer-plugin to be specific - not working Maven 插件问题:maven-enforcer-plugin:3.0.0-M3:enforce 有些 Enforcer 规则失败 - Problem with Maven plugin :maven-enforcer-plugin:3.0.0-M3:enforce Some Enforcer rules have failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM