I want to use same configuration for FindBugs irrespective of whether it is executed form eclipse or ant build.
Using ant FindBugs task, it is possible to specify which classes FindBugs should analyze. However, FindBugs eclipse plugin has no such option. It considers all classes in the buildpath.
E.g. In case of maven based project the eclipse build path contains both application classes and test classes. I want FindBugs eclipse plugin to not analyze test classes. Is it possible?
Is there a way to customize FindBugs eclipse plugin to indicate classes to analyze?
Thanks in advance.
It doesn't seem possible, but you could create a second project referencing the same source files (sources only, not tests).
Findbugs would only be active with that second project, for you to inspect the result of a static code analysis.
You can specify exclusion filter for Java project via preferences -> filter. The filter file is written in xml. See "Filters" chapter in FB manual: http://findbugs.sourceforge.net/manual/filter.html.
Since 2.0.3 one also can re-use Eclipse configuration with ant builds, see the help for "userPreferencesFile" ant option: http://findbugs.sourceforge.net/manual/anttask.html#d0e1339
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With