How to make a gradle build finish successful with checkstyle errors?

checkstyle, gradle

Solution

There is an even nicer and easier solution than that from Rene. Just add:

checkstyle {
   ignoreFailures = true
}

to your build.gradle file.

Problem

I haven an Android Gradle build that is run on Jenkins. Jenkins checks checkstyle warnings and errors and publishes the results. If there is a checkstyle error the build stops and is marked as failed. Jenkins also stops and does not publish the checkstyle report. How can I let the build run through even with checkstyle errors?

Original source