Looking for sample how to use FindBugs plugin with filter files


(aizmaylov) #1

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

$ findbugs -exclude myExcludeFilter.xml myApp.jar

in original FindBugs


(Justin Ryan) #2

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


(aizmaylov) #3

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?


(aizmaylov) #4

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?


(Justin Ryan) #5

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:


(Luke Daley) #6

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

Do you know what it is?


(Justin Ryan) #7

There wasn’t one. Is that required?

Luckily Daniel Gredler added one, GRADLE-2375


(Peter Niederwieser) #8

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

findbugs {

excludeFilter = file(“myExcludeFilter.xml”)

}


(Luke Daley) #9

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


(Justin Ryan) #10

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