我想使用qulice-maven-plugin,并且我不想使用默认的findBugs规则,而只需设置一次自定义即可。那可能吗?
-另外,我不希望qulice-maven-plugin因checkstyle违规而失败,但我不想禁用该插件。如何更改默认的qulice-maven-plugin,checkstyle配置?

<build>
  <plugins>
    <plugin>
      <groupId>com.qulice</groupId>
      <artifactId>qulice-maven-plugin</artifactId>
      <version>0.16.4</version>
      <configuration>
        <license>file:${basedir}/LICENSE.txt</license>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>check</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

最佳答案

无法覆盖查询规则。其背后的基本思想是它具有一组不可更改的规则。因此,每个使用qulice的项目看起来都差不多。

您只能使用regexp(checkstyle:。*)禁用查询,如下所示:

<plugin>
    <groupId>com.qulice</groupId>
    <artifactId>qulice-maven-plugin</artifactId>
    <version>0.16.5</version>
    <configuration>
        <license>file:./LICENSE.txt</license>
        <excludes>
            <exclude>findbugs:~com.qulice.foo.M.*</exclude>
            <exclude>findbugs:com.qulice.foo.Bar</exclude>
            <exclude>findbugs:.*</exclude>
            <exclude>checkstyle:.*</exclude>
        </excludes>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>check</goal>
            </goals>
        </execution>
    </executions>
</plugin>


因此,您只能满足第二个要求-如果checkstyle失败,构建不会失败。
对于findbug,您将需要使用SuppressFBWarnings(来自edu.umd.cs.findbugs.annotations),如下所示:@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")

10-08 20:22
查看更多