maven-cobertura-plugion不显示源 [英] maven-cobertura-plugion does not show the sources
问题描述
当我通过运行"mvn cobertura:cobertura"(或"mvn网站")生成Cobertura报告时,会生成一个报告,其中显示了我的课程的测试覆盖率,但是当我单击某个课程时,会显示消息无法进行找到de/ailis/foo/Bar.java.您是否指定了源目录?"被陈列.我怎样才能解决这个问题?我在pom.xml中这样配置插件:
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>
那么我该如何为该插件指定源目录(为什么需要,maven总是知道源在哪里,显然它们已经被使用了,否则我应该得到一个空的报告).
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).
推荐答案
我不认为 Cobertura报告直接指向真实资源(不会与站点一起部署) ),但您应该生成Source Xref报告(Java源代码的HTML版本).
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).
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jxr-maven-plugin</artifactId>
</plugin>
...
<plugins>
</reporting>
您可以尝试一下吗?
这篇关于maven-cobertura-plugion不显示源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!