My build fails on checkstyle errors (not warnings). As long as there are any checkstyle errors i want the warnings are not shown in the (maven produced) output. How to achieve this?
# First is error, should be reported, second is a warning, should not be reported in the maven output.
...data/Decimal.java:286:31: '7L' is a magic number.
.../data/Decimal.java:296:5: warning: Missing a Javadoc comment.
UPDATE: See my comment. This question is NOT about suppressing specific warnings! It is only about not displaying all warnings in the maven output!
You can configure your Checkstyle rules in the Idea's Code Style config (File -> Settings -> Code Style) and then reformat the code (Code -> Reformat Code [Ctrl+Alt+L]) according to the rules (you can apply it to the whole code base at once). Save this answer. Show activity on this post. reformat your code.
checkstyle:checkstyle is a reporting goal that performs Checkstyle analysis and generates a report on violations. checkstyle:checkstyle-aggregate is a reporting goal that performs Checkstyle analysis and generates an aggregate HTML report on violations in a multi-module reactor build.
There is no such option in checkstyle.
You can use filters to show you only errors, but there is no option to hide events by level if higher level exists. You can write such filter http://checkstyle.sourceforge.net/writingfilters.html#Writing_Filters
Had the same problem with lots of warnings. As a quick hack it is possible to just filter out "warning" lines with inverted grep match:
mvn clean install | grep -v warning
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With