|
This plugin allows you to capture code coverage report from Emma. Hudson will generate the trend report of coverage. Usage with Maven21. The Maven2 Emma plugin requires Maven >= 2.0.8 and Surefire >= 2.3. 2. Add the following to your POM file: <build>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<inherited>true</inherited>
<executions>
<execution>
<goals>
<goal>instrument</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
...
</build>
<reporting>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<inherited>true</inherited>
</plugin>
...
</plugins>
</reporting>
3. Make sure the Surefire plugin configuration you have, to run your tests, has the following in it's configuration: <forkMode>always</forkMode> 4. You should add the following to your plugin repositories (either in your POM or in your settings.xml) to locate the Emma plugin:
<pluginRepositories>
...
<pluginRepository>
<id>snapshots.repository.codehaus.org</id>
<url>http://snapshots.repository.codehaus.org</url>
</pluginRepository>
...
</pluginRepositories>
5. Run the "site" goal in your build to generate Emma report. OutputThis will create target/site/emma/coverage.xml when you run mvn site, which can then be referenced by the Hudson plugin: |

