Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the same Findbugs bugs in Maven and Eclipse

I managed to run findbugs within my maven build process, and I also have findbugs configured in eclipse. However when running in Eclipse and Maven I get different bugs, and I can't seem to find a setting, where the number of bugs matches in Eclipse and Maven.

My Maven settings is like this:

<version>2.5.2</version>
<configuration>
        <failOnError>false</failOnError>
        <threshold>Normal</threshold>
        <effort>Default</effort>
        <xmlOutput>true</xmlOutput>
        <findbugsXmlOutput>true</findbugsXmlOutput>
        <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
</configuration>

And in Eclipse I have:

Findbugs Version: 2.0.1
Analysis Effort: Default
Minimum Rank to report: 20
Minimum Confidence to Report: Medium
Reported categories: All

With those settings, I get more bugs in Eclipse. My main problem is, that I can't even match the different settings between maven and eclipse.

like image 616
Thomas M. Avatar asked Oct 30 '12 09:10

Thomas M.


2 Answers

You could try using m2e-code-quality, which includes an m2eclipse 'connector' that should ensure your Eclipse FindBugs configuration matches the configuration specified in your pom.

like image 113
Martin Ellis Avatar answered Nov 06 '22 17:11

Martin Ellis


I'm having exactly the same problem. There is a mismatch between settings available in Eclipse (using FindBugs 2.0.1) and the Maven plugin (version 2.5.2). One setting that is missing from the Maven plugin is 'confidence'. Using another piece of software to match the configurations doesn't address the issue because the Eclipse matching just highlights a problem. I want certain bugs reported from the Maven build completely independently of Eclipse that aren't being reported. It just happens that it is possible to have them reported in Eclipse.

like image 37
pnightingale Avatar answered Nov 06 '22 17:11

pnightingale