Unable to exclude files in findbugs usging gradle 4.6

FindBugs version: 3.0.1

When using gradle 2.14.1 to 3.6, below scripts could exclude files(Kotlin) well:

tasks.withType(FindBugs) {
    exclude '**/com/xxx/*'
    classes = classes.filter {
        !it.path.contains(new File("com/xxx").path)
    }
    reports {
        xml.enabled = false
        html.enabled = true
    }
}

But when changed to using gradle 4.6, above scripts unable to exclude file.

Why and how to solve this? Thanks for any help.