Allow for filtering of findbugs

Choose version 2.5.2 which is what is supported by CDT's HIPP.  Note that by removing the version altogether, the latest available findBugs would be selected.  However, this could lead to different results between manual builds and HIPP builds, which is why I thought it would be better to specify the version explicitly.

FindBugs can be run by adding the string

 findbugs:findbugs

as a maven parameter, either in a local maven build, or on HIPP.

Add releng/findbugs-exclude.xml to control the errors shown by FindBugs.
The content of that file was copied from the TM project, but should
eventually be ajusted for CDT.

Change-Id: Ibc8348b9286f00580a4079a7ca3c669708bc6194
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Marc Khouzam 2015-02-04 13:26:47 -05:00 committed by Elena Laskavaia
parent 059db21d52
commit 78cd08f40d
2 changed files with 73 additions and 4 deletions

View file

@ -586,9 +586,10 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.2</version>
<version>2.5.2</version>
<configuration>
<findbugsXmlOutput>true</findbugsXmlOutput>
<xmlOutput>true</xmlOutput>
<excludeFilterFile>releng/findbugs-exclude.xml</excludeFilterFile>
<failOnError>false</failOnError>
</configuration>
<executions>
@ -602,11 +603,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<version>2.7.1</version>
<configuration>
<sourceEncoding>utf-8</sourceEncoding>
<minimumTokens>100</minimumTokens>
<targetJdk>1.6</targetJdk>
<targetJdk>1.7</targetJdk>
<format>xml</format>
<failOnViolation>false</failOnViolation>
</configuration>

View file

@ -0,0 +1,68 @@
<FindBugsFilter>
<!-- Set maximum rank level to 16 -->
<Match>
<Rank value="17"/>
</Match>
<!-- Ignore all I18N Internationalization bugs -->
<Match>
<Bug category="I18N"/>
</Match>
<!-- Ignore all NM_SAME_SIMPLE_NAME_AS_SUPERCLASS or NM_SAME_SIMPLE_NAME_AS_INTERFACE violations -->
<Match>
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/>
</Match>
<Match>
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/>
</Match>
<!-- Ignore all SF_SWITCH_NO_DEFAULT violations -->
<Match>
<Bug pattern="SF_SWITCH_NO_DEFAULT"/>
</Match>
<!-- Ignore all serialization violations -->
<Match>
<Or>
<Bug pattern="SE_BAD_FIELD"/>
<Bug pattern="SE_BAD_FIELD_INNER_CLASS"/>
<Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE"/>
</Or>
</Match>
<!-- Ignore all inner class should be static violations -->
<Match>
<Or>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC"/>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS"/>
</Or>
</Match>
<!-- Ignore all REC_CATCH_EXCEPTION -->
<Match>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<!-- Ignore all STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE -->
<Match>
<Bug pattern="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE"/>
</Match>
<!-- Ignore all ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD violations in bundle activators -->
<Match>
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
<Or>
<Method name="start" params="org.osgi.framework.BundleContext" returns="void"/>
<Method name="stop" params="org.osgi.framework.BundleContext" returns="void"/>
<Class name="~.*\.Activator"/>
</Or>
</Match>
<!-- Ignore RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE -->
<Match>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>
</FindBugsFilter>