2012-09-04 39 views
9

我在命令行上通過mvn構建我的項目。通過Maven CLI識別CheckStyle錯誤

每當發生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?

回答

8

CheckStyle將報告保存到target/checkstyle-result.xml(對於非模塊化項目)。所以你可能會找到這個文件並檢查它。

另一種情況是配置maven-checkstyle-plugin顯示所有這樣的警告/安慰錯誤:

<consoleOutput>true</consoleOutput>