Skip to main content

FindBugs - how to tell maven where is the exclude file

In previous post I wrote how to write exclude file using findbugs GUI. Now there is a need to tell maven where is the exclude file.



A way to do so, is to put the exclude file near the pom file. Let's call it findbugs-exclude.xml. Now, add to pom file the below section:

pom.xml section
<profiles>
 <profile>
  <id>findbugs</id>
  <build>
   <plugins>
    <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>findbugs-maven-plugin</artifactId>
     <configuration>
      <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
     </configuration>
    </plugin>
   </plugins>
  </build>
 </profile>
</profiles>





findbugs-exclude.xml

<FindBugsFilter>
    <Match>
        <Class name = "com.hp.alm.platform.db.CTdPreparedStatement"/>
        <Bug pattern = "SQL_BAD_PREPARED_STATEMENT_ACCESS"/>
        <Bug category = "CORRECTNESS"/>
    </Match>
</FindBugsFilter>

Comments

Popular posts from this blog

Best freeware - XML editor

As a software developer, I open XML files all the time. I a heavy commercial XML editor. But nothing can compare to a small, thin and free XML editor like 'foxe'. A great feature is has is the alignment of long XML strings to readable XML format (Shift-F8). It help lot of times when the XML file was generated by some tool and was not readable. Homepage: http://www.firstobject.com/dn_editor.htm

SSL in pictures

Here is my summary on SSL (or as I like to call it 'SSL for dummies')

Jenkins error: groovy.lang.MissingPropertyException

I tried to run groovy build step and got below error. This post will describe how I solved the problem. Caught: groovy.lang.MissingPropertyException: No such property: hudson for class: script