[GRADLE-2473] Findbugs task does not honor Findbugs extension properties. Created: 12/Sep/12  Updated: 04/Jan/13  Resolved: 12/Sep/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.2-rc-1
Fix Version/s: 1.3-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 0


 Description   

My build.gradle contains:

apply plugin: 'findbugs'
findbugs

{ toolVersion = '2.0.1' effort = 'min' excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml") }

This is the same exclude filter that we use in our Maven projects and we get a clean Findbugs run. However, I got Findbugs errors with gradle. To verify if excludeFilter was being honored, I changed the contents to:

<FindBugsFilter>
<Match>
<Package name="~.*"/>
</Match>

The above should match ALL packages and effectively exclude everything from Findbugs. Even with the above filter, I get the exact same results as before which leads me to believe that excludeFilter is not really being honored.

------------------------------------------------------------
Gradle 1.2-rc-1
------------------------------------------------------------

Gradle build time: Tuesday, September 4, 2012 5:49:54 PM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Ivy: 2.2.0
JVM: 1.7.0_05 (Oracle Corporation 23.1-b03)
OS: Mac OS X 10.8.1 x86_64



 Comments   
Comment by Gradle Forums [ 12/Sep/12 ]

Hello,
in gradle 1.2-rc-1 you have to define the excludeFilters per task. this means that instead of using

findbugs {
excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml")
}

you have to declare it explicitly for your findbugsMain task:

findbugsMain {
excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml")
}

This is already fixed on master

cheers,
René

Comment by Gradle Forums [ 12/Sep/12 ]

Ah of course, thanks Rene!

Comment by Gradle Forums [ 12/Sep/12 ]

BTW, the documentation here is misleading: [1]http://gradle.org/docs/release-candid...
----------------------------------------------------------------------------------------
[1] http://gradle.org/docs/release-candidate/dsl/org.gradle.api.plugins.quality.FindBugsExtension.html

Comment by Gradle Forums [ 12/Sep/12 ]

thanks for pointing this out. much appreciated!

Generated at Wed Jun 30 12:22:53 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.