我正在使用带有 Checkstyle 2.13 插件的 Maven 3.2.3。我有一个多模块项目,并且在父 pom 中有这个配置……</p>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.13</version>
<reportSets>
<reportSet>
<reports>
<report>checkstyle</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</reporting>
当我运行“mvn site”时,构建成功,没有错误或警告。在 target/site/index.html 生成报告文件,但是当我在浏览器中访问该页面时,我看不到检查样式报告。更糟糕的是,当我单击“项目模块”部分下的每个模块的链接时,我得到 404。每个链接都将指向 target/site/module-N/index.html,但是不会生成这样的文件。
编辑:根据评论中的建议,我添加了这个
<distributionManagement>
...
<site>
<id>sourceforge-snapshot-site</id>
<name>Snapshot Site</name>
<url>scp://shell.sourceforge.net/home/project-web/checkstyle/htdocs/snapshot</url>
</site>
</distributionManagement>
这只是一个满足建议的虚拟条目,但即使将其放入,site:stage 也无法纠正损坏的链接。