1

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

我在 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] ------------------------------------------------------------------------
4

1 回答 1

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>
于 2013-09-16T22:44:11.730 回答