15

我在命令行上通过mvn构建我的项目。

每当发生 checkStyle 错误时,我都会看到这种类型的输出:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-
plugin:2.4:checkstyle (default) on project myProject-server: 
An error has occurred in Checkstyle report generation. 
There are 2 checkstyle errors. -> [Help 1]

如何找出导致这些 CheckStyle 失败的代码行?

4

1 回答 1

19

CheckStyle 将报告保存到target/checkstyle-result.xml(对于非模块化项目)。所以你可能会找到这个文件并检查它。

另一种情况是配置maven-checkstyle-plugin为向控制台显示所有此类警告/错误:

<consoleOutput>true</consoleOutput>
于 2012-09-05T15:35:15.063 回答