需要相同的版本
此规则强制特定依赖项和/或插件具有相同的版本。
此规则支持以下参数:
示例插件配置:
<project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>3.0.0</version> <executions> <execution> <id>enforce-no-snapshots</id> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <requireSameVersions> <plugins> <plugin>org.apache.maven.plugins:maven-surefire-plugin</plugin> <plugin>org.apache.maven.plugins:maven-failsafe-plugin</plugin> <plugin>org.apache.maven.plugins:maven-surefire-report-plugin</plugin> </plugins> </requireSameVersions> <requireSameVersions> <dependencies> <dependency>org.apache.maven</dependency> <!-- or org.apache.maven:* --> </dependencies> </requireSameVersions> </rules> </configuration> </execution> </executions> </plugin> </plugins> </build> [...] </project>