Gradle - how to exclude Findbugs on /src/test/java
findbugs, gradle
Solution
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.
Problem
Is there a way to exclude Findbugs execution on classes under /src/test/java. I tried the following but it doesn't seem to work. ``` classes = classes.filter { !it.path.contains("**classes\\test\\org*") } ```