as you can see the checkstyle warn,but the build of this time is still success. why? I want it faild. please help.
D:\MyData\xxxx>gradle clean checkstyleMain
:clean
:compileJava
:processResources
:classes
:checkstyleMain
[ant:checkstyle] [WARN] D:\MyData\xxxx.java:218:18: Member name 'Aource'
must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'. [MemberName]
BUILD SUCCESSFUL
Total time: 4.966 secs
```
see the img: https://i.stack.imgur.com/7IbRM.jpg
see the checkstyle.xml: https://i.stack.imgur.com/BE4An.jpg
EDIT: There is better solution since I wrote that answer -> use
maxErrors=0
as xxSwordy mentioned here https://stackoverflow.com/a/57141028/3464596.Here is PR: https://github.com/gradle/gradle/pull/3901
There is possible to do it for errors by:
ignoreFailures = false
For warnings, there IS NOT POSSIBLE to do that, see [this][1] ticket.
From their old Jira and new GitHub issue comments there is one workaround:
So answer is: This is not possible by default and there is still opened ticket for that. If you really WANT IT, you can try to participate and try to fix it, Gradle is opensource and it depends on developers :) [1]: https://github.com/gradle/gradle/issues/881