views:

436

answers:

2

I am working on a very large legacy code base. We are looking to introduce findbugs into the development practice.

I intend to have findbugs run whenever the code is built by eclipse.

I would like to be able to make the findbugs warnings appear as errors in the code much in this way you can change the severity level in eclipse

Is it possible for eclipse to report the warnings it produces as errors?

Thanks

A: 

No, it isn't possible to have the FindBugs Eclipse plugin mark potential bugs as errors in the code.

I did some checking and the FindBugs Maven plugin doesn't provide an option to do this either (so no luck there too).

I would suggest logging an RFE (request for enhancement) to the FindBugs Eclipse plugin developers. Their bug tracking database is available here.

shek
A: 

I do not think so. Errors in Eclipse are reported by Eclipse's JDT compiler, whereas the FindBugs plugin simply reports warnings by plugging into the Eclipse system. I am not sure if the compiler can know of FindBugs' presence and get its list of warnings to report as errors.

However, if you trying to get the build to fail because of FindBugs warnings, you can try their ANT task, and cause the build to fail if there are any warnings.

Parag