标签详解
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.4.1</version> <executions> <execution> <id>default-cli</id> <!--一个执行实例的id--> <goals> <goal>enforce</goal> <!--执行的命令--> </goals> <phase>validate</phase> <!--执行的阶段--> <configuration> <rules> <!--规则--> <requireMavenVersion> <!--要求的Maven版本--> <version>[3.1,)</version> </requireMavenVersion> <requireJavaVersion> <!--要求的Java版本--> <message> <!--失败后提示消息--> <![CDATA[You are running an older version of Java. This application requires at least JDK ${java.version}.]]> </message> <version>[1.8,)</version> </requireJavaVersion> <requireSameVersions> <!--要求版本一致的dependency--> <dependencies> <!-- Ensure that the version of the library used is consistent across the different dependencies resolved. --> <dependency>com.xxx.fid.core:jsonic-*</dependency> </dependencies> </requireSameVersions> <bannedDependencies> <!--禁止出现的dependency--> <excludes> <!--黑名单:禁止出现的dependency--> <!-- Prevent the inclusion of pre-SONIC 3.2.0 artifacts in the resolved dependencies. --> <exclude>com.xxx.fiet.core:jsonic*</exclude> </excludes> <includes> <!--白名单:黑名单里的例外情况--> <!-- ..apart from jsonic-interactions (deprecated, but not yet excised from jmarketlib-api library --> <include>com.xxx.fiet.core:jsonic-interactions:4.0.1</include> </includes> </bannedDependencies> </rules> </configuration> </execution> </executions> </plugin>
更多细节