简体   繁体   English

Findbugs在并行Gradle构建中记录太多

[英]Findbugs logs too much in a parallel Gradle build

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. 我正在等待Gradle 3.0被释放以查看它是否会被修复但不幸的是它没有。 The issue is that if you use parallel builds in Gradle, for example using these command-line flags: 问题是如果您在Gradle中使用并行构建,例如使用这些命令行标志:

--parallel --max-workers=20

Then Gradle is very verbose in its debugging. 然后Gradle的调试非常冗长。 Our project is fairly large and Findbugs is adding over 10,000 lines of log messages. 我们的项目相当大,Findbugs正在添加超过10,000行日志消息。 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: build.gradle中的Findbugs配置很简单:

// 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. 几年前在Gradle论坛上对此进行了讨论。 See https://discuss.gradle.org/t/add-an-option-to-pass-quiet-to-findbugs-plugin/554 . 请参阅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? 有没有其他人遇到这个并找到了解决方案?

This issue was fixed. 这个问题已修复。 Gradle 4.2 removes all the extra Findbugs logging without having to do anything in the build.gradle. Gradle 4.2删除所有额外的Findbugs日志记录,而无需在build.gradle中执行任何操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM