我的构建在checkstyle错误(不是警告)上失败。只要有任何checkstyle错误,我希望警告不会显示在(maven生成的)输出中。怎么做到这一点?
# 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.
更新:看我的评论。这个问题不是要抑制特定的警告!它只是不显示maven输出中的所有警告!
答案 0 :(得分:3)
checkstyle中没有这样的选项。
您可以使用过滤器仅向您显示错误,但如果存在更高级别,则无法按级别隐藏事件。您可以编写此类过滤器http://checkstyle.sourceforge.net/writingfilters.html#Writing_Filters
答案 1 :(得分:-2)
有很多警告同样的问题。作为一个快速黑客,可以过滤掉警告"具有反向grep匹配的行:
mvn clean install | grep -v warning