Getting NoClassDefFoundError when using findbugs

I am running gradle 2.4 with findbugs, the findbugs config is such:

findbugs {
    sourceSets = [sourceSets.main]
    ignoreFailures = true

The issue is that I get the following exception:

Caused by: java.lang.NoClassDefFoundError: [Ljavax/annotation/meta/When;
	at edu.umd.cs.findbugs.FindBugs2.clearCaches(
	at edu.umd.cs.findbugs.FindBugs2.execute(

So this might be a classpath issue with findbugs. I have multiple modules in my project, and this only fails on one of them. So I am not sure why I would get the error on one module, and not others. What can affect the classpath of findbugs? Can my dependencies override something in findbugs? Still can’t see how that would cause a class to disappear.

Ok, looks like I had the following at the top:

all*.exclude group: "", module: "jsr305"
all*.exclude group: "", module: "annotations"

I might need to see if removing those breaks something else. I know I had issues in the past with jsr305 annotations and jetty due to security constraints (javax.annotation package exists in java, with signing, the jsr305 classes are not part of that signature).