如何在EmmaMaven项目中逐行覆盖xml文件 [英] How to get line by line coverage xml file in Emma- maven project

查看:60
本文介绍了如何在EmmaMaven项目中逐行覆盖xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Maven项目中使用Emma工具.Emma在HTML文件中创建逐行代码覆盖率,但不显示逐行代码覆盖率XML文件.它仅提供一个摘要XML文件.有没有一种方法可以在Emma中保留或逐行覆盖XML文件?

I am using the Emma tool in Maven project. Emma creates line by line code coverage in HTML file, it does not display line by line code coverage XML file. It gives only a summary XML file. Is there a way to keep or generate line by line code coverage XML file in Emma?

我在 pom.xml

<reporting>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-project-info-reports-plugin</artifactId>
      <version>2.7</version>
      <configuration>
        <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
      </configuration>
    </plugin>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>emma-maven-plugin</artifactId>
      <version>1.0-alpha-3</version>
      <inherited>true</inherited>
    </plugin>
  </plugins>
</reporting>

我缺少任何配置吗?如果是这样,我应该在pom中输入什么?(完整的 pom.xml 文件将不胜感激).

Am I missing any configuration? If so where should I enter it in pom? (A complete pom.xml file will be appreciated).

我已经使用Eclipse创建了我的项目,并使用以下代码在cmd中运行了该项目:

I have created my project using Eclipse and ran it in cmd using the code:

mvn emma:emma

我也在Emma-maven插件中输入了以下内容

also i have entered following inside the Emma-maven pluggin

<configuration>
            <outputDirectory>${project.build.directory}</outputDirectory>
        </configuration>

推荐答案

是的,您可以设置属性 maven.emma.report.xml 转换为 true 生成XML报告(默认情况下为 false ).将生成文件 target/coverage.xml .

Yes, you can set the property maven.emma.report.xml to true to generate a XML report (it is false by default). The file target/coverage.xml will be generated.

示例命令:

mvn emma:emma -Dmaven.emma.report.xml=true

这篇关于如何在EmmaMaven项目中逐行覆盖xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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