We recently performed a build system upgrade to gradle 2.2.1 and Oracle java 8u25. The CM build machines and some developer machines work fine. But on other developer machines, the build fails with:
The version of FindBugs (0.0.0) inferred from FindBugs classpath is too low to work with currently used Java version (1.8). Please use higher version of FindBugs. Inspected FindBugs classpath: [yjp-controller-api-redist.jar, ant.jar, findbugs-ant.jar, annotations.jar, jdepend-2.9.jar, jFormatString.jar, jcip-annotations.jar, jaxen-1.1.6.jar, findbugs-3.0.0.jar, commons-lang-2.6.jar, asm-debug-all-5.0.2.jar, bcel-6.0-SNAPSHOT.jar, dom4j-1.6.1.jar, jsr305.jar]
The error message is a bit confusing because from looking at the code it should detect the FindBugs version to be 3.0.0 and not 0.0.0.
What exactly do you mean by “We search for the findbugs jar with: ‘findbugs externalDirectory.matching {include “findbugs/3.0.0/lib/*.jar”}’”? Why do you need to redefine the ‘findbugs’ configuration?
I think that the problem might originate from the fact that you have ‘findbugs-ant.jar’ on the classpath as well. Iteration order over files will be different on different file systems and on some ‘findbugs-ant.jar’ will be analysed instead of ‘findbugs-3.0.0’. Where is this ant support file coming from?
Can you please explain what is the type of ‘externalDirectory’ in your snippet of code? Is it a configuration?
Why do you manually pull FindBugs into some local dir? Are you not allowed to use Maven Central? Why don’t you simply define the required version using ‘findbugs.toolVersion’ and then allow Gradle to resolve FindBugs from Maven Central for you?
Renaming ‘findbugs-ant.jar’ to ‘findbugs-ant-3.0.0.jar’ will not fix it because the version detection pattern is ‘findbugs-(.*).jar’ which means that you cannot have any other jar file that starts with ‘findbugs’ on the classpath. I would suggest renaming it to ‘ant-findbugs.jar’.