我对Maven Checkstyle插件有疑问。问题是它创建了一个输出文件,但失败了,因为该文件的确以换行符结尾(插件应检查该行):
[ERROR] target/checkstyle-result.xml:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
我尝试使用以下方法从该插件中排除目标目录:
<properties>
<checkstyle.excludes>**/target/**</checkstyle.excludes>
</properties>
但是什么也没做。
该插件本身是在父pom.xml文件中配置的,因此我对此没有任何控制。
有什么建议吗?
答案 0 :(得分:0)
我遇到了同样的问题,并解决了。您的规则(以及之前的规则)存在的问题如下:
**/target/**
与文件target/checkstyle-result.xml
不匹配。更好的方法是**/target/**/*
checkstyle.resourceExcludes
属性。