This is the documentation for Clover 3.3. View this page for the

Unknown macro: {spacejump}

of Clover, or visit the latest Clover documentation.

Any of Clover's Ant Tasks may be used directly from within Maven 2 by using the maven-antrun-plugin.

Specifically, if you wanted to use the clover-check task to ensure that a particular package maintains a given coverage percentage, you could use the following configuration in Maven 2:

<profile>
     <id>clover.check</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>com.cenqua.clover</groupId>
                                <artifactId>clover</artifactId>
                                <version>2.5.0</version> <!-- Ensure you use the same version as the maven-clover2-plugin -->
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <configuration>
                                    <tasks>
                                        <property name="clover.license.path" location="${user.home}/clover.license"/>  <!-- Change this to point to your license -->
                                        <taskdef resource="cloverlib.xml" classpathref="maven.plugin.classpath"/>
                                        <clover-setup initString="${project.build.directory}/clover/clover.db"/>
                                        <clover-check filter="${clover.filter}" haltOnFailure="true">
                                            <package name="com.mypkg" target="100%"/> <!-- Check that com.mypkg always has 100% code coverage -->
                                        </clover-check>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
</profile>
  • No labels