------ Maven 2 Clover Plugin Introduction ------ Vincent Massol ------ October 6th, 2006 ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed under the Apache License, Version 2.0 (the "License"); ~~ you may not use this file except in compliance with the License. ~~ You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, software ~~ distributed under the License is distributed on an "AS IS" BASIS, ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~~ See the License for the specific language governing permissions and ~~ limitations under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/guides/mini/guide-apt-format.html Maven Clover Plugin The Clover plugin is the place where build actions related to {{{http://www.cenqua.com/clover/}Clover}} are found in Maven. Clover is a tool that generates Test Coverage reports. It is free for non-commercial use. If your project is a commercial project you will need to get a license for the Clover jar before using this plugin. Please note that a 30 days license is included in this plugin. * Features The Clover plugin currently supports the following features: * Instrumenting Java sources with Clover so that they generate coverage logs to a {{{http://cenqua.com/clover/doc/adv/database.html}Clover database}} when they are exercised. * Aggregating Clover databases found in children modules into a single database so that reporting and checking for test coverage can be done at the level of the full project. * Generation of Clovered artifacts into your local repository, including Clovered EAR, WAR, RAR, etc containing a bundled Clover JAR. This allows including automated functional tests coverage into the Clover reports. * Generating a report from a {{{http://cenqua.com/clover/doc/adv/database.html}Clover database}}. * Verifying that your source code has a defined test coverage percentage and fail the build if it's below that level. This is the equivalent of the {{{http://cenqua.com/clover/doc/ant/checktask.html}Clover Check Ant task}}. * Dumping information about your {{{http://cenqua.com/clover/doc/adv/database.html}Clover database}}. Note that the Clover plugin will <> overwrite your main compiled classes nor your main test compiled tests classes. It creates a parallel directory in <<>> in order not to tamper with your main files. * Usage Instructions on how to use Maven Clover Plugin can be found {{{usage.html}here}}. * Goals Overview The <<>> has seven goals, but only six are called directly by the user. The full description of goals, generated automatically from the source code, is available {{{plugin-info.html}here}}. * {{{aggregate-mojo.html}clover:aggregate}} - Aggregate children module Clover databases if there are any. This mojo should not exist. It's only there because the site plugin doesn't handle @aggregators properly at the moment... * {{{check-mojo.html}clover:check}} - Verify Test Percentage Coverage (TPC) from an existing Clover database and fail the build if it is below the defined threshold. The check is done on main Clover databases and also on merged Clover databases when they exist. * {{{instrumentInternal-mojo.html}clover:instrumentInternal}} - Instrument source roots. <> * {{{instrument-mojo.html}clover:instrument}} - Instrument all sources using Clover and forks a custom lifecycle to execute project's tests on the instrumented code so that a Clover database is created. Note: We're forking a lifecycle because we don't want the Clover instrumentation to affect the main lifecycle build. This will prevent instrumented sources to be put in production by error. Thus running mvn install on a project where this instrument goal has been specified will run the build twice: once for building the project as usual and another time for instrumenting the sources with Clover and generating the Clover database. * {{{log-mojo.html}clover:log}} - Provides information on the current Clover database. * {{{clover-mojo.html}clover:clover}} - Generate a Clover report from existing Clover databases. The generated report is an external report generated by Clover itself. If the project generating the report is a top level project and if the aggregate configuration element is set to true then an aggregated report will also be created. Note: This report mojo should be an @aggregator and the clover:aggregate mojo shouldn't exist. This is a limitation of the site plugin which doesn't support @aggregator reports... * {{{save-history-mojo.html}clover:save-history}} - Save a {{{http://cenqua.com/clover/doc/tutorial/part2.html}Clover history point}}. * Examples Check the {{{http://svn.apache.org/viewcvs.cgi/maven/plugins/trunk/maven-clover-plugin/src/it/}plugin test suite}} for example of how to use this plugin.