在 gradle 中如何禁用单个项目的 findbugs 或 checkstyle 插件

kel*_*yfj 3 java findbugs checkstyle gradle

我们在 Java 中有一个多项目构建,其中 8 个项目中有两个是系统测试,我们不想针对系统测试代码(位于“src/main/java”)运行 FindBugs 或 Checkstyle。

我在顶级 build.gradle 文件中启用了 findbugs / checkstyle 但想要“禁用”插件在这两个项目中运行?

kel*_*yfj 6

我喜欢 gradle 原来很简单

//Disable findbugs and checkstyle as per legacy ant build.xml
findbugs {
 sourceSets = []
}

checkstyle {
 sourceSets = []
}
Run Code Online (Sandbox Code Playgroud)