Maven + Emma code coverage example

Emma is a free Java code coverage tool. In this tutorial, we will show you how to use Maven to generate the Emma code coverage report for your project, and also how to integrate the Emma report into the Maven project site. 1. Generate Emma Code Coverage Report Do nothing, just type the following Maven …

Read more

Emma – Class x appears to be instrumented already

Review the “maven-emma-plugin” in pom.xml : pom.xml <project> //… <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>emma-maven-plugin</artifactId> <version>1.0-alpha-3</version> <inherited>true</inherited> <executions> <execution> <phase>process-classes</phase> <goals> <goal>instrument</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <inherited>true</inherited> <configuration> <forkMode>once</forkMode> <reportFormat>xml</reportFormat> <classesDirectory> ${project.build.directory}/generated-classes/emma/classes </classesDirectory> </configuration> </plugin> </plugins> </build> </project> 1. Problem When I run the command mvn emma:emma to generate the code coverage report, …

Read more