此规则检查项目的 POM 中是否声明了重复的依赖项。重复依赖项是具有相同组 ID、工件 ID、类型和分类器的依赖项。
此规则支持以下参数:
示例插件配置:
<project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>3.0.0</version> <executions> <execution> <id>no-duplicate-declared-dependencies</id> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <banDuplicatePomDependencyVersions/> </rules> </configuration> </execution> </executions> </plugin> </plugins> </build> [...] </project>