我正在关注编写自定义规则文档来创建自定义规则并应用它。
我的执行器插件执行在 pom.xml 文件中有以下条目-
<execution>
<id>enforce-no-masters</id>
<configuration>
<skip>${masterDependenciesAllowed}</skip>
<rules>
<myCustomRule implementation="or.apache.customRule.CustomRule">
<excludes>
<exclude>*:*:master-*:*:*</exclude>
</excludes>
<shouldIfail>false</shouldIfail>
</myCustomRule>
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
问题是,如果我坚持下去<shouldIfail>true</shouldIfail>
,我总是会失败,如果我坚持下去<shouldIfail>false</shouldIfail>
,我总是会成功。
所以我不知道如何将java类变量的值shouldIfail
放在标签中,以便它根据逻辑动态传递或失败。