Question

I am using maven with emma to generate coverage report on linux red hat. After I run command mvn emma:emma, packages which are not covered by JUnit tests are not displayed in the report.

I am using following configuration:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>emma-maven-plugin</artifactId>
    <version>1.0-alpha-3</version>    
</plugin>

Any idea what is going on? Or any way to make sure all packages including uncovered are part of report?

Was it helpful?

Solution

note this was supposed to be a comment, and It doesn't answer not answer the question directly. It questions the usefulness of the question.

Quit using emma and start using jacoco. AFAIK, emma has been dormant since around 2007. The latest version of the emma plugin on maven central is from 2010.

As of today (fist quarter 2013). There is a version on maven central from feb-2013.

<dependency>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco</artifactId>
    <version>0.6.2.201302030002</version>
</dependency>

And it is synchronized with the maven plugin. Here is an example of a configuration of mine

<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>

The reports from jacoco also look nicer than the ones in emma.

Compare: A screenshot of a sample report from the emma website

with A screenshot of a sample report from the jacoco website

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top