Findbugs task ignores "excludes" property set via "exclude" method

Hi there,

in the following code, I’m setting an exclude pattern for all Findbugs tasks, but it doesn’t seem to work:

tasks.withType(FindBugs) {
  exclude '**/org/jsense/serialize/protobuf/gen/*'

The relevant classes are still included.

I believe this is a bug. Note that using the exact same syntax for both the Checkstyle and PMD plugin works, so I don’t think it’s an issue with my project. I’ve got it to work using the “excludeFilter” property in the FindBugsExtension. Perhaps see the changes in this commit on Github for how I got it working:


FindBugs primarily operates on class files, so you’ll have to filter those as well (see my answer to your Stack Overflow post).

Yes, thanks very much. As noted on SO as well (for good measure, a link:, I think this is rather counter-intuitive. Perhaps it could be made explicit in the documentation that exclusion of classes is what’s important?

But thank you for the solution, works perfectly.

1 Like