Set custom findBugs rules, disable failsOnViolation using qulice-maven-plugin

437 views Asked by At

I want to use qulice-maven-plugin and I do not want to use the default findBugs rules but to set my custom once. Is that possible? - Also, I do not want qulice-maven-plugin to fail on checkstyle violations, but I do no want to disable the plugin. How to change the default qulice-maven-plugin, checkstyle configuration?

<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>
1

There are 1 answers

2
Krzysztof Krasoń On

It is not possible to override the rules in qulice. The basic idea behind it is that it has a set of rules that are not changeable. So each project that uses qulice looks more/less the same.

You can only disable qulice using regexp (checkstyle:.*), like this:

<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>

So you can achieve only the second requirement - build won't fail if checkstyle fails. For findbugs you would need to use SuppressFBWarnings (from edu.umd.cs.findbugs.annotations) like this: @SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")