Which emma-maven-plugin should I be using?
Asked Answered
F

2

12
  1. org.sonatype.maven.plugin:emma-maven-plugin:1.2
  2. org.codehaus.mojo:emma-maven-plugin:1.0-alpha-3
  3. org.apache.maven.plugins:maven-emma-plugin:0.5
Feasible answered 2/3, 2012 at 10:21 Comment(0)
A
2

I'm not sure which one is the best. I do know that there is hardly any documentation on the sonatype plugin (other than this blog). Also I think the apache one is rather old, so personally I would try the codehaus plugin.

Apothecium answered 2/3, 2012 at 11:44 Comment(1)
Fair enough. Codehaus is what I've been using for a while now, but recently I've had classpath issues when running 'mvn site' ('mvn deploy' works just fine) where I wanted to specifically control the sequence of the dependencies. The Sonatype plugin didn't have that problem, but instead, I found it wasn't creating a .txt or .xml report, just a .html one (and wrong charset at that). My work around is to revert back to the Codehaus plugin, and configure my CI to run 'mvn site' in a separate profile to 'mvn deploy' (the classpath issue has to do with using dbdeploy for certain database tests)Feasible
S
17

Use jacoco - emma in no longer supported. Jacoco supports java 7.

<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.5.6.201201232323</version>
  <executions>
    <execution>
      <id>jacoco-initialize</id>
      <phase>initialize</phase>
      <goals>
        <goal>prepare-agent</goal>
      </goals>
    </execution>
    <execution>
      <id>jacoco-site</id>
      <phase>package</phase>
      <goals>
        <goal>report</goal>
      </goals>
    </execution>
  </executions>
</plugin>
Sande answered 2/3, 2012 at 13:1 Comment(3)
It's a great suggestion, but I didn't mark it as the answer because it answers a slightly different question. JaCoCo looks promising, but still young. I notice you need an XSLT workaround to get it working with Hudson / Jenkins. issues.jenkins-ci.org/browse/JENKINS-10835Feasible
There is the reason that I started using sonar with jenkins. If you use jenkins do not add emma to your pom - just call emma:emma.Sande
petrikainulainen.net/programming/maven/… has a good writeup on integrating org.jacoco.Edson
A
2

I'm not sure which one is the best. I do know that there is hardly any documentation on the sonatype plugin (other than this blog). Also I think the apache one is rather old, so personally I would try the codehaus plugin.

Apothecium answered 2/3, 2012 at 11:44 Comment(1)
Fair enough. Codehaus is what I've been using for a while now, but recently I've had classpath issues when running 'mvn site' ('mvn deploy' works just fine) where I wanted to specifically control the sequence of the dependencies. The Sonatype plugin didn't have that problem, but instead, I found it wasn't creating a .txt or .xml report, just a .html one (and wrong charset at that). My work around is to revert back to the Codehaus plugin, and configure my CI to run 'mvn site' in a separate profile to 'mvn deploy' (the classpath issue has to do with using dbdeploy for certain database tests)Feasible

© 2022 - 2024 — McMap. All rights reserved.