Maven Checkstyle 插件 - 测试 XREF
我的 Maven 报告运行良好,除了 Checkstyle 和测试外部参照之外。我的测试源仍在外部参照而不是测试外部参照处交叉引用。因此,当我单击 Checkstyle 报告中的外部参照时,我自然会收到错误,找不到文件。如果我单击源文件,它就可以完美运行。
我在配置中尝试了testXrefLocation,但没有成功。这是设计使然,还是我缺少配置?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<enableRulesSummary>false</enableRulesSummary>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<configLocation>${project.build.directory}/checkstyle.xml</configLocation>
<testXrefLocation>${project.reporting.outputDirectory}/xref-test</testXrefLocation>
</configuration>
</plugin>
mvn clean install site
在生成所有这些内容的目标目录中,我同时拥有外部参照和外部参照测试。但是,我的测试源代码的 checkstyle 报告仍然链接到 target/xref 而不是 target/xref-test。
另外,仅供参考,我使用大量继承来减少单个 Maven POM 中的配置量。因此,这个插件属于一个父pom,它声明了我想使用哪些插件进行测试。我还有另一个说除了编译的代码之外我还想生成 javadoc 和源代码。
沃尔特
My maven reports are working great, all except Checkstyle and test xref. My test source is still being cross referenced at xref and not the test xref. So, when I click on the xref from within a Checkstyle report, I naturally get an error, the file isn't found. If I click on a source file, it works perfectly.
I tried testXrefLocation in the configuration to no avail. Is this by design, or am I missing a configuration?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<enableRulesSummary>false</enableRulesSummary>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<configLocation>${project.build.directory}/checkstyle.xml</configLocation>
<testXrefLocation>${project.reporting.outputDirectory}/xref-test</testXrefLocation>
</configuration>
</plugin>
mvn clean install site
In my target directory where all this stuff is generated, I have both xref and xref-test. However, my checkstyle reports for my test source code are still linked to target/xref and not target/xref-test.
Also, FYI, I am using a lot of inheritance to reduce the amount of configuration in a single Maven POM. Therefore, this plugin belongs to a parent pom which declares which plugins I want to use for testing. I have another that says I want to generate javadoc and source in addition to the compiled code.
Walter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,我最终删除了此配置,转而使用 Sonar,因为它通过更好的 UI 为我提供了更多信息。
I actually ended up removing this configuration in favor of using Sonar since it gives me much more information with a nicer UI.