Maven Cobertura插件未生成coverage.xml [英] Maven Cobertura plugin not generating coverage.xml

查看:490
本文介绍了Maven Cobertura插件未生成coverage.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试生成coverage.xml,以便可以在Hudson的Cobertura插件中引用它,但未创建文件.

I am trying to generate a coverage.xml so that I can reference it in Cobertura plugin of Hudson, but the file is not being created.

我已将以下内容添加到我的POM中

I've added the following to my POM

 <reporting>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
               <formats>
                   <format>html</format>
                   <format>xml</format>
               </formats>
            </configuration>
        </plugin>
    </plugins>
</reporting>

运行mvn cobertura:cobertura后,将按预期的方式在** \ target \ site \ cobertura中生成HTML站点,但是在任何地方都找不到coverage.xml.我想念/误解了什么?

After running mvn cobertura:cobertura, the HTML site is generated as expected at **\target\site\cobertura, but coverage.xml is nowhere to be found. What am I missing/misunderstanding?

我正在运行Maven 3.0.3

I am running Maven 3.0.3

推荐答案

对于Maven插件和Hudson及其插件之间的连接,我还是一个新手-因此,无论如何这都不是一个明智的答案,但可以帮助您在Google上解决此问题的机会很少,而且相差甚远-因此希望它对以后的人有所帮助.

I'm still quite a novice with the connections between Maven Plugins and Hudson and it's plugins - so this isn't an intelligent answer by any means, but help on Google is very few and far between for this issue - so hopefully it helps someone in the future.

花了几个小时修改设置后,我发现coverage.xml似乎根本不是本地构建的.

After spending a few more hours of tinkering with settings, I've found that the coverage.xml simply doesn't seem to be built locally.

这是使它起作用的组合:

This is the combination that got it working:

  1. 我在POM中将版本更改为2.2(我正在获取资源 找不到来自Apache的带有2.5.1的错误)
  2. 在我的哈德森目标中添加了cobertura:cobertura
  3. 将Cobertura覆盖模式设置为 推荐**/target/site/cobertura/coverage.xml
  1. I had changed my version to 2.2 in my POM (I was getting resource not found errors from Apache with 2.5.1)
  2. Added cobertura:cobertura in my Hudson goal
  3. Set the Cobertura coverage pattern to the recommended **/target/site/cobertura/coverage.xml

这篇关于Maven Cobertura插件未生成coverage.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆