Plugin Documentation

Goals available for this plugin:

Goal Report? Description
cobertura:check No Check the coverage percentages for unit tests from the last instrumentation, and optionally fail the build if the targets are not met. To fail the build you need to set configuration/check/haltOnFailure=true in the plugin's configuration.
cobertura:check-integration-test No Check the coverage percentages for unit tests and integration tests from the last instrumentation, and optionally fail the build if the targets are not met. To fail the build you need to set configuration/check/haltOnFailure=true in the plugin's configuration.
cobertura:clean No Clean up the files that Cobertura Maven Plugin has created during instrumentation.
cobertura:cobertura Yes Instrument the compiled classes, run the unit tests and generate a Cobertura report.
cobertura:cobertura-integration-test Yes Instrument the compiled classes, run the unit tests and integration tests and generate a Cobertura report.
cobertura:dump-datafile No Output the contents of Cobertura's data file to the command line.
cobertura:help No Display help information on cobertura-maven-plugin.
Call mvn cobertura:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
cobertura:instrument No Instrument the compiled classes.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 2.0.8
JDK 1.6
Memory No minimum requirement.
Disk Space No minimum requirement.

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>cobertura-maven-plugin</artifactId>
          <version>2.7</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.7</version>
      </plugin>
      ...
    </plugins>
  </build>
  ...
  <!-- To use the report goals in your POM or parent POM -->
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.7</version>
      </plugin>
      ...
    </plugins>
  </reporting>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"