# Findbugs plugin ignores "ignoreFailures" properties

**URL:** <https://discuss.gradle.org/t/findbugs-plugin-ignores-ignorefailures-properties/2122>\
**Category:** Old Forum Archive\
**Created:** [April 19, 2012, 5:49am UTC](https://discuss.gradle.org/t/findbugs-plugin-ignores-ignorefailures-properties/2122 "2012-04-19T05:49:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![geert\_subcribe1](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/geert_subcribe1/32/216_2.png) [@geert\_subcribe1](https://discuss.gradle.org/u/geert_subcribe1)\
**Post date:** [April 19, 2012, 5:49am UTC](https://discuss.gradle.org/t/findbugs-plugin-ignores-ignorefailures-properties/2122/1 "2012-04-19T05:49:00Z")

</div>

I migrated from milestone-8 to rc-1 and now my build breaks because the findbugs plugin ignores the setting of the ignoreFailure property (we have some timing tests and running with cobertura is much slower than plain junit).

After quite some fiddling with the source of the plugin, it appears this is due to line 119 in FindBugs.groovy:

if (findbugsResult.bugCount && !ignoreFailures) { it should be

if (findbugsResult.bugCount && !getIgnoreFailures()) {

I’m not an expert on gradle, but it appears this property is now part of a convention object which requires different access than before???

---

<div class="post-metadata">

**Author:** ![Rene](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/rene/32/8082_2.png) [@Rene](https://discuss.gradle.org/u/Rene)\
**Post date:** [April 19, 2012, 6:11am UTC](https://discuss.gradle.org/t/findbugs-plugin-ignores-ignorefailures-properties/2122/2 "2012-04-19T06:11:00Z")

</div>

Hello geert, thanks for the report. I’ll fix this immediately. for the mean time you can use the following workaround to set the ignoreFailures property for all your findbugs tasks:

```gradle
tasks.withType(FindBugs){
    ignoreFailures = true
}

```

---

<div class="post-metadata">

**Author:** ![geert\_subcribe1](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/geert_subcribe1/32/216_2.png) [@geert\_subcribe1](https://discuss.gradle.org/u/geert_subcribe1)\
**Post date:** [April 19, 2012, 6:26am UTC](https://discuss.gradle.org/t/findbugs-plugin-ignores-ignorefailures-properties/2122/3 "2012-04-19T06:26:00Z")

</div>

Thanks for the quick (!) workaround.

---

<div class="post-metadata">

**Author:** ![Rene](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/rene/32/8082_2.png) [@Rene](https://discuss.gradle.org/u/Rene)\
**Post date:** [April 19, 2012, 6:40am UTC](https://discuss.gradle.org/t/findbugs-plugin-ignores-ignorefailures-properties/2122/4 "2012-04-19T06:40:00Z")

</div>

I exported this problem as a bug to our jira instance at [http://issues.gradle.org/browse/GRADLE-2243](http://issues.gradle.org/browse/GRADLE-2243)

---

<div class="post-metadata">

**Author:** ![Rene](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/rene/32/8082_2.png) [@Rene](https://discuss.gradle.org/u/Rene)\
**Post date:** [April 19, 2012, 3:43pm UTC](https://discuss.gradle.org/t/findbugs-plugin-ignores-ignorefailures-properties/2122/5 "2012-04-19T15:43:00Z")

</div>

this is fixed on master and will be part of gradle 1.1

---

<div class="post-metadata">

**Author:** ![m\_joehren](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/m_joehren/32/562_2.png) [@m\_joehren](https://discuss.gradle.org/u/m_joehren)\
**Post date:** [May 11, 2012, 9:07am UTC](https://discuss.gradle.org/t/findbugs-plugin-ignores-ignorefailures-properties/2122/6 "2012-05-11T09:07:00Z")

</div>

Hm, strange, why does the workaround not work for me? I have a root project with several sub projects. Root project does not have any java stuff but all subprojects. When i use ms 9 everything works fine with finbugs and ignoreFailures. But when I am on rc1,2,3 it is not working. I also added the mentioned workaround but that does not help either… I added it like that:

```gradle
subprojects { Project sub ->
    sub.afterEvaluate { Project p ->
        p.tasks.withType(Compile) { options.encoding = "UTF-8" }
        p.tasks.withType(FindBugs) { ignoreFailures = true }
    }
}

```

---

<div class="post-metadata">

**Author:** ![m\_joehren](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/m_joehren/32/562_2.png) [@m\_joehren](https://discuss.gradle.org/u/m_joehren)\
**Post date:** [May 11, 2012, 9:10am UTC](https://discuss.gradle.org/t/findbugs-plugin-ignores-ignorefailures-properties/2122/7 "2012-05-11T09:10:00Z")

</div>

ok, without afterEvaluate it works…
