How do I remove some jars from the bootclasspath that Findbugs uses?


My OSGi application uses the bootclasspath to enforce compilation against the right EE by putting the right ee.j2se jar on there. I want to remove that jar from the bootclasspath when running FindBugs since that jar is API only, and has all functions stubbed out with returning null thus resulting in many false positives.

How do I do this?

I haven’t been able to find this.

[Edit] To make it a bit clearer, the project sets up the bootclasspath like so:

if (!bnd_classPathBoot.isEmpty()) {

def classPathBootAsPath = files(bnd_classPathBoot).asPath


+= ["-Xbootclasspath/p:$classPathBootAsPath"]


+= ["-Xbootclasspath/p:$classPathBootAsPath"] }

This is the last hurdle I have to take before we can fully support a gradle build with bndtools

I tried to hack around it by filtering the ee.j2se jars from the bootclasspath on the compiler args, but that doesn’t work. Is there a way to control the bootclasspath that findbugs uses?

I don’t see why the Jar would be on any of FindBugs’ class paths. You only added it to the compiler’s boot class path, which FindBugs doesn’t care about.

Thanks, you’re right.

I checked more thoroughly and it appears that I had been working too long on this and couldn’t see clearly any more.

So thanks again!