Findbugs logs too much in a parallel Gradle build
Asked Answered
C

1

6

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?

Cuneate answered 2/9, 2016 at 17:53 Comment(2)
The issue was moved to github github.com/gradle/gradle/issues/1307, I hope it gets resolved soon!Miller
The issue says it has been resolved in Gradle 4.2 RC1. Give it a try and update your question.Achromatism
C
0

This issue was fixed. Gradle 4.2 removes all the extra Findbugs logging without having to do anything in the build.gradle.

Cuneate answered 3/10, 2017 at 19:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.