Gradle - how to exclude Findbugs on /src/test/java

≡放荡痞女 提交于 2019-12-05 02:21:58

Sure. The documentation of the Findbugs extension says:

sourceSets : The source sets to be analyzed as part of the check and build tasks.

And the example just above shows an example doing exactly what you want:

apply plugin: "findbugs"

findbugs {
    sourceSets = [sourceSets.main]
}

i.e. only analyze the main sourceSet, and not the test sourceSet.

For Gradle 4.5.1

apply plugin: 'findbugs'

findbugs {
    findbugsTest.enabled = false
}

It isn't mentioned anywhere in documentation, at least I, as 1 day gradle user, don't find it, but it works.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!