To generate an code coverage report on demand with the default settings, just execute the emma:emma goal on your project:
mvn emma:emma
To include the emma coverage report in the project site, add the following to the reporting section of your project:
<project>
...
<reporting>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>1.0-alpha-3</version>
</plugin>
...
</plugins>
...
</reporting>
...
</project>Note: best practice is to specify the version of plugins in order to ensure that your build is reproducible. The above example will always use the latest version of the emma-maven-plugin.
To include the emma coverage report in all child projects, add the following to the parent project:
<project>
...
<reporting>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>1.0-alpha-3</version>
<inherited>true</inherited>
</plugin>
...
</plugins>
...
</reporting>
...
</project>