请注意,这应该是评论,它不回答不直接回答问题。它质疑这个问题的有用性。
退出使用 emma 并开始使用jacoco。AFAIK,自 2007 年左右以来,emma 一直处于休眠状态。maven Central 上的 emma 插件的最新版本是 2010 年开始的。
截至今天(2013 年第一季度)。从 2013 年 2 月开始,maven central 上有一个版本。
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco</artifactId>
<version>0.6.2.201302030002</version>
</dependency>
并且与maven插件同步。这是我的配置示例
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/entities/*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
jacoco 的报告也比 emma 的报告好看。
相比:

和
