Checkstyle - 报告没有显示任何内容

时间:2013-09-12 14:22:13

标签: jenkins hudson jenkins-plugins checkstyle hudson-plugins

报告已创建,但没有任何检查样式信息(错误,......) 它只显示项目名称和布局。

我在pom.xml中添加了插件

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>2.10</version>
        </plugin>
    </plugins>
</reporting>

我运行mvn site命令。

然后我得到输出:

[INFO] --- maven-site-plugin:3.0:site (default-site) @ parent-project ---
[INFO] configuring report plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.10
[WARNING] Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version.
[WARNING] 
[INFO] There are 98008 checkstyle errors.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating "About" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Plugin Management" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Dependencies" report    --- maven-project-info-reports-plugin:2.7
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building sub-project1 1.4.0.2
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] 
[INFO] parent-project ..................................... SUCCESS [22.137s]
[INFO] sub-project1 ..................................... SUCCESS [13.183s]
[INFO] sub-project2 ....................................... SUCCESS [21.192s]
[INFO] sub-project3 .................................... SUCCESS [35.919s]
[INFO] sub-project4 ...................................... SUCCESS [31.328s]
[INFO] sub-project5 .................................... SUCCESS [35.976s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:39.955s
[INFO] Finished at: Thu Sep 12 18:49:32 IST 2013
[INFO] Final Memory: 64M/775M
[INFO] ------------------------------------------------------------------------

1 个答案:

答案 0 :(得分:2)

您应该将maven-jxr-plugin添加到报告插件部分。

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jxr-plugin</artifactId>
            <version>2.3</version>
        </plugin>
    </plugins>
</reporting>