开发者

maven-cobertura-plugion does not show the sources [closed]

开发者 https://www.devze.com 2023-01-05 23:11 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

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 wh开发者_StackOverflowy is that needed, maven always knows where the source are and obviously they are already used because otherwise I should get an empty report).


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>

Could you give this a try?

0

精彩评论

暂无评论...
验证码 换一张
取 消