Skip to content

Commit

Permalink
[FIXED JENKINS-36715] - Invoke FindBugs during the Jenkins core build (
Browse files Browse the repository at this point in the history
…#2458)

* Move FindBugs call to the parent POM, always run it and generate XMLs

* Update FindBugs to 3.0.4

* Filter away Stream encoding issues

* Rework FindBugs definitions according to comments from @jtnord

* Generalize configuration, findbugs:findbugs now takes it.

* Add TODOs to FindBugs excludes file

* Remove explicit failOnError

* Fix the typo spotted by @jtnord
  • Loading branch information
oleg-nenashev committed Aug 1, 2016
1 parent 9d75aa1 commit d8cae82
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 16 deletions.
4 changes: 4 additions & 0 deletions cli/pom.xml
Expand Up @@ -92,6 +92,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
24 changes: 11 additions & 13 deletions core/pom.xml
Expand Up @@ -42,6 +42,8 @@ THE SOFTWARE.
<stapler.version>1.243</stapler.version>
<spring.version>2.5.6.SEC03</spring.version>
<groovy.version>2.4.7</groovy.version>
<!-- Currently there is a huge number of errors => we cannot fix all of them immediately -->
<findbugs.failOnError>false</findbugs.failOnError>
</properties>

<dependencies>
Expand Down Expand Up @@ -803,6 +805,10 @@ THE SOFTWARE.
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -878,20 +884,12 @@ THE SOFTWARE.
</profile>
<profile>
<!-- Run FindBugs for better error detection. Run as "mvn -Pfindbugs install site". -->
<!-- FindBugs has been moved to the default build flow, but here we fail the build on errors-->
<id>findbugs</id>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<effort>Max</effort>
<threshold>High</threshold>
<excludeFilterFile>src/findbugs-filter.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
</reporting>
<properties>
<!-- In the default profile we always fail the build if there FindBugs errors -->
<findbugs.failOnError>true</findbugs.failOnError>
</properties>
</profile>
<profile>
<!-- Obtain code coverage report. This is done by running Unit tests on our own and suppressing surefire. -->
Expand Down
27 changes: 24 additions & 3 deletions pom.xml
Expand Up @@ -96,7 +96,8 @@ THE SOFTWARE.
<matrix-project.version>1.4.1</matrix-project.version>
<sorcerer.version>0.11</sorcerer.version>
<animal.sniffer.skip>${skipTests}</animal.sniffer.skip>
<findbugs-maven-plugin.version>3.0.1</findbugs-maven-plugin.version>
<findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version>
<findbugs.failOnError>true</findbugs.failOnError>
<test-annotations.version>1.2</test-annotations.version>

<java.level>7</java.level>
Expand Down Expand Up @@ -500,6 +501,24 @@ THE SOFTWARE.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${findbugs-maven-plugin.version}</version>
<configuration>
<effort>Max</effort>
<threshold>High</threshold>
<!--Excludes file is located on the top level-->
<excludeFilterFile>../src/findbugs/findbugs-excludes.xml</excludeFilterFile>
<xmlOutput>true</xmlOutput>
<findbugsXmlOutput>false</findbugsXmlOutput>
</configuration>
<executions>
<execution>
<id>findbugs</id>
<goals>
<goal>check</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -735,6 +754,8 @@ THE SOFTWARE.
</execution>
</executions>
</plugin>


</plugins>

<extensions>
Expand Down Expand Up @@ -773,7 +794,7 @@ THE SOFTWARE.
</profile>
<profile>
<id>metrics</id>
<reporting>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand All @@ -783,7 +804,7 @@ THE SOFTWARE.
</configuration>
</plugin>
</plugins>
</reporting>
</build>
</profile>
<profile>
<id>debug</id>
Expand Down
Expand Up @@ -4,13 +4,17 @@
<!-- Used for backward compatibility and extending utility classes -->
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/>
<!-- Various debug probes have non final static fields -->
<!-- TODO: Replace by in-code annotations -->
<Bug pattern="MS_SHOULD_BE_FINAL"/>
<!-- Groovy generates this -->
<Bug pattern="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS"/>
<!-- TODO: It's a real issue, but the code is flooded by it right now-->
<Bug pattern="DM_DEFAULT_ENCODING"/>
</Or>
</Match>

<!-- exclude medium and low priorities -->
<!--TODO: Cleanup code and remove filtering of medium-priority issues-->
<Match>
<Priority value="2"/>
</Match>
Expand Down

0 comments on commit d8cae82

Please sign in to comment.