【问题标题】:Identifying CheckStyle Errors via Maven CLI通过 Maven CLI 识别 CheckStyle 错误
【发布时间】:2012-08-29 08:52:57
【问题描述】:

我通过命令行上的 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 失败的代码行?

【问题讨论】:

    标签: checkstyle


    【解决方案1】:

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

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

    <consoleOutput>true</consoleOutput>
    

    【讨论】:

      猜你喜欢
      • 2020-03-17
      • 2011-11-09
      • 2020-11-08
      • 1970-01-01
      • 2015-07-25
      • 2019-12-02
      • 2015-12-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多