We have been dealing with the issue for the last couple of years. I was waiting for Gradle 3.0 to be released to see if it would be fixed but unfortunately it has not. The issue is that if you use parallel builds in Gradle, for example using these command-line flags:
--parallel --max-workers=20
Then Gradle is very verbose in its debugging. Our project is fairly large and Findbugs is adding over 10,000 lines of log messages. Some look like this:
[:app:findbugsMain] Scanning archives (0 / 207)
[:app:findbugsMain] Scanning archives (1 / 207)
[:app:findbugsMain] Scanning archives (2 / 207)
[:app:findbugsMain] Scanning archives (3 / 207)
[:app:findbugsMain] Scanning archives (4 / 207)
[:app:findbugsMain] Scanning archives (5 / 207)
[:app:findbugsMain] Scanning archives (6 / 207)
[:app:findbugsMain] Scanning archives (7 / 207)
[:app:findbugsMain] Scanning archives (8 / 207)
[:app:findbugsMain] Scanning archives (9 / 207)
and then others look like this:
[:app:findbugsMain] Pass 1: Analyzing classes (446 / 662) - 67% complete
[:app:findbugsMain] Pass 1: Analyzing classes (447 / 662) - 67% complete
[:app:findbugsMain] Pass 1: Analyzing classes (448 / 662) - 67% complete
[:app:findbugsMain] Pass 1: Analyzing classes (449 / 662) - 67% complete
[:app:findbugsMain] Pass 1: Analyzing classes (450 / 662) - 67% complete
[:app:findbugsMain] Pass 1: Analyzing classes (451 / 662) - 68% complete
[:app:findbugsMain] Pass 1: Analyzing classes (452 / 662) - 68% complete
[:app:findbugsMain] Pass 1: Analyzing classes (453 / 662) - 68% complete
[:app:findbugsMain] Pass 1: Analyzing classes (454 / 662) - 68% complete
[:app:findbugsMain] Pass 1: Analyzing classes (455 / 662) - 68% complete
The Findbugs configuration in build.gradle is simple:
// findbugs plugin settings
findbugs {
sourceSets = [sourceSets.main]
ignoreFailures = true
effort = 'max'
excludeFilter = rootProject.file("config/findbugs/findbugs-exclude.xml")
}
There was a discussion of this on the Gradle forums a few years ago. See https://discuss.gradle.org/t/add-an-option-to-pass-quiet-to-findbugs-plugin/554. There were other people seeing the same issue but none of the workarounds seem to help. Everyone agrees it has to do with parallel builds and I agree since I do not see this in any of my non-parallel projects.
Has anyone else run across this and found a solution?