Looking for sample how to use FindBugs plugin with filter files

Can anybody provide sample how to use FindBugs plugin with filter files. Something similar to:

$ findbugs -exclude myExcludeFilter.xml myApp.jar

in original FindBugs

Have you tried this:

findbugsMain {
                effort 'min'
                reportLevel 'high'
                includeFilter file('include.xml')
                excludeFilter file('exclude.xml')
                visitors = ['FindDeadLocalStores', 'UnreadFields']
                omitVisitors = ['WaitInLoop', 'UnnecessaryMath']
            }

In your specific case:

findbugsMain {
     excludeFilter file('myExcludeFilter.xml')
}

It was added as part of https://github.com/gradle/gradle/pull/78

I’m getting the error: * What went wrong: A problem occurred evaluating root project ‘MyProject’. > Could not find method excludeFilter() for arguments [D:\Projects\MyProject\findbugsExcludeFilter.xml] on root project ‘MyProject’.

And there is another warning before: Deprecated dynamic property: “excludeFilter” on “task ‘:findbugsMain’”, value: “D:\Projects\MyProject…”

Can you help?

I’m getting the error:

  • What went wrong:

A problem occurred evaluating root project ‘MyProject’.

Could not find method excludeFilter() for arguments [D:\Projects\MyProject\findbugsExcludeFilter.xml] on root project ‘MyProject’. And there is another warning before:

Deprecated dynamic property: “excludeFilter” on “task ‘:findbugsMain’”, value: “D:\Projects\MyProject…”

Can you help?

I take it back. The pull request was never accepted, and there’s no comments to why it wasn’t. There is currently no way to do any of the useful and necessary pieces of findbugs. :frowning:

Justin, I can’t find the relevant JIRA issue for the pull request.

Do you know what it is?

There wasn’t one. Is that required?

Luckily Daniel Gredler added one, GRADLE-2375

This will go into 1.2-rc-1, and the syntax is:

findbugs {

excludeFilter = file(“myExcludeFilter.xml”)

}

@Justin: We won’t pull any code without an issue ticket (we make exceptions for small documentation changes).

Can someone add documentation to http://www.gradle.org/contribute concerning what people should do and expect when contributing?