我有一个gradle模块,它对兄弟模块有编译时依赖性。
dependencies {
compile project(':sibling-module')
}
在运行构建时,FindBugs似乎无法找到依赖项,因此我收到以下消息:
The following classes needed for analysis were missing:
com.example.siblingmodule.classname
我需要做些什么来包含这些文件,以便FindBugs可以评估它们?我正在使用FindBugs 3.0.1和gradle 3.5。
答案 0 :(得分:1)
看起来Gradle没有为FindBugs配置类路径的属性,但它仍然有一个sourceSets
属性来指定要分析的源代码文件夹。
答案 1 :(得分:1)
我找到了答案,感谢@webdizz指出我正确的方向。解决方案是将兄弟模块输出添加到findbugs类路径中。我在抱怨模块的build.gradle
:
findbugsMain {
classpath += project(':sibling-module').sourceSets.main.output
}
重要的一点是要包含main.output
,而不仅仅是main.allSource
。