[GRADLE-3457] Findbugs version cannot be determined when multiple libraries starting with findbugs are on the classpath Created: 23/May/16  Updated: 25/Jan/17  Resolved: 23/May/16

Status: Resolved
Project: Gradle
Affects Version/s: 2.6
Fix Version/s: 3.0-milestone-1, 3.0-rc-2

Type: Bug
Reporter: Stefan Wolf Assignee: Stefan Wolf
Resolution: Fixed Votes: 0


See https://groups.google.com/forum/#!topic/gradle-dev/fMXJ6mRTK4c :

While moving my codebase to compile with Java8, found out that the Regular Expression that is been used to match the FindBugs Jar version is not strict enough to match what is required (which is findbugs-MAJOR.MINOR.MICRO.jar), and that cause to match other Jars , therefore, the build will fail with build exception:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':findbugsRelease'.
    > 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: [asm-xml-5.0.4.jar, dom4j-1.6.1.jar, commons-lang-2.6.jar, asm-analysis-5.0.4.jar, jsr305.jar, asm-tree-5.0.4.jar, findbugs-annotations-3.0.0.jar, asm-5.0.4.jar, jcip-retry.jar, jcip-annotations.jar, findbugs-3.0.0.jar, asm-util-5.0.4.jar, jaxen-1.1.1.jar, findbugs-jFormatString-3.0.0.jar, asm-commons-5.0.4.jar, findbugs-bcel-6.0-SNAPSHOT.jar]

The Line of code that has the regular expression is located here:

Instead of:
Matcher m = Pattern.compile("findbugs-(.*)

I want to fix it by changing it to:
Matcher m = Pattern.compile("findbugs-(\\d+.*)

This fix will make the regex will match only "findbugs-3.0.0.jar" from a list like this: ["findbugs-annotations-2.0.3.jar", "findbugs-3.0.0.jar", "findbugs-bcel-6.0-SNAPSHOT.jar", "findbugs-jFormatString-3.0.0.jar"]

Comment by Stefan Wolf [ 23/May/16 ]

Solved by https://github.com/gradle/gradle/pull/642.

Generated at Wed Jun 30 12:49:20 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.