Using findbugs with groovy code


I am trying to get the findbugs plugin working with my groovy project and I am not having much luck getting it to run. Is it possible to use findbugs with groovy and gradle? Or am I barking up the wrong tree. Ideally I want to run a check to ensure that I am not using the default file encoding in my project and codenarc doesn’t supply this check.

Thanks in advance


It seems like FindBugs should work with groovy code. You’ll have to compile your groovy scripts first though. According to Wikipedia: “FindBugs operates on Java bytecode, rather than source code”

Can you be more specific with the problem that you’re having? It may also help to post the gradle build script that you’re using.

Hi Thanks for the reply. Looking at the findbugs plugin source I think the problem is that the plugin only seems to look for Java source files which is why the groovy files are not being picked up.

Not sure if there is a reason for this? Regards Brian