maven-cobertura-plugion 不显示来源
当我通过运行“mvn cobertura:cobertura”(或“mvn site”)生成 Cobertura 报告时,会生成一个报告,其中显示我的类的测试覆盖率,但是当我单击一个类时,会出现消息“无法定位 de/ ailis/foo/Bar.java。您指定了源目录吗?”显示。我该如何解决这个问题?我在 pom.xml 中配置了插件,如下所示:
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</reporting>
那么我如何指定这个插件的源目录(为什么需要这个目录,maven 总是知道源在哪里,显然它们已经被使用了,否则我应该得到一个空的报告)。
When I generate a Cobertura report by running "mvn cobertura:cobertura" (or "mvn site") then a report is generated which shows the test coverage for my classes but when I click on a class then the message "Unable to locate de/ailis/foo/Bar.java. Have you specified the source directory?" is displayed. How can I fix this? I configured the plugin in the pom.xml like this:
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</reporting>
So how can I specify the source directory for this plugin (And why is that needed, maven always knows where the source are and obviously they are already used because otherwise I should get an empty report).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为 Cobertura 报告直接指向真实源(不会与站点一起部署),但您应该生成源外部参照报告(HTML 版本的Java 源代码)。
你能尝试一下吗?
I don't think that the Cobertura report is pointing directly on the real sources (that wouldn't get deployed with a site) but that you are supposed to generate the Source Xref report (an HTML version of the Java sources).
Could you give this a try?