How to make gradle build completion succeed with checkstyle errors?

I have an Android Gradle build that runs on Jenkins.

Jenkins checks for warnings and validation errors and publishes the results. If there is a checkstyle error, the assembly stops and is flagged as a failure. Jenkins also stops and does not publish a checklist report.

How can I let the build work even with checkstyle errors?

+5
source share
3 answers

There is an even more pleasant and easy solution than that of Rene. Just add:

checkstyle { ignoreFailures = true } 

to the build.gradle file.

+8
source

The Checkstyle task can be configured to ignore failures:

 checkstyleTask.ignoreFailures = true 
+4
source

If you are looking for a solution that provides the above functionality, as well as an error report in html format and puts the entire checkstyle configuration in gradle, look at gradle-estilo-plugin .

On the side, no, I have to point out that I myself wrote this plugin, and I widely use it in all my projects.

0
source

Source: https://habr.com/ru/post/1207725/


All Articles