You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This page contains the installation instructions for Clover-for-Maven 2. On this page:

To use Clover with a Maven 2 project you only need to make small changes to settings.xml and pom.xml.

  1. Set up your .m2/settings.xml by adding:
    .m2/settings.xml
    ...
    <pluginGroups>
        <pluginGroup>com.atlassian.maven.plugins</pluginGroup>
    </pluginGroups>
    ...
    
    to tell Maven where to look for the plugin.

    (info) This step is not needed if you wish to only run Clover via the pom.xml.

  2. Set up your pom.xml by adding:
    pom.xml
    <build>
        <plugins>
            ...
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-clover2-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    


    (info) You will need to set up your licence, as a <licenseLocation> element in your pom.xml configuration file.

    (warning) You need a valid Clover license file to run Clover. You can obtain a free 30 day evaluation license or purchase a commercial license at http://my.atlassian.com.

  3. Now, simply invoke Clover with Maven on the command line. This will instrument your sources, build your project, run your tests and create a Clover coverage database. Use the following code:
    mvn clover2:instrument clover2:aggregate clover2:clover
    
    which will create a coverage report. The coverage report will be created in this directory:
    target/site/clover
    

    Clover should now be fully set up for basic operation.

For more license configuration options, see the FAQ pages.

For more instructions, see the Clover-for-Maven 2 User's Guide.

  • No labels