|
This page contains best practices for using Clover for Maven 2. On this page:
Test Optimization in a CI EnvironmentThere are two recommended ways to utilize Clover's test optimization in a CI (Continuous Integration) environment, either using a Profile, or to run the goals directly. Setting up a CI Profile
Running the Clover2 goals DirectlyAdd a new build plan with the following command line:
Test Optimization on the DesktopRunning Clover's test optimization locally is very advantageous. This is achieved using the 'clover.optimize' profile that can be activated like so: Combining Build Optimization with Site Coverage ReportingMaven2 will merge any executions defined in the default build section of the pom, with those defined in a profile. It is therefore recommended practice to always use two profiles — one for test optimization and one for generating a Clover report when you generate a site. The The 'clover.report' profile is an example of a build profile to activate when running this command: Using separate profiles for site generation and Test Optimization is currently the recommended way to have both a site and a Test Optimization Clover build configured in the same Test Optimization across a Multimodule ProjectBy default, Clover will generate a new You can achieve the desired behaviour however, by configuring Clover to use a single If you have many modules, you may need to set fullBuildEvery to a value higher than the default of 10. See also singleCloverDatabase.
clover2:setup Non-forked Lifecycleclover2:setup is a new MOJO designed to make integration with integration and functional tests a lot simpler than using the forked lifecycle that comes with clover2:instrument. It also has the added advantage of not having to run your tests twice. Executing clover2:setup does the following:
Therefore, executing: , will instrument all source and test files, compile the instrumented source files, run all tests and then install the compiled and instrumented classes. WARNING: It is not recommended to deploy your Clover instrumented classes to an external Maven repository. clover2:setup will automatically bind itself to the 'process-sources' phase if defined in the goals list of the plugin's executions.
Colouring Test OptimizationIf your terminal supports ANSI escape codes, run your Maven build with the Screenshot: Coloured Text in Clover Log Messages Build ProfilesThe following profiles can be used directly in the pom.xml. This avoids the need to modify the ~/.m2/settings.xml file. clover.report Profile
Clover Optimize Profile
Clover Optimize, Report, Log and Check Profile
Related Links |
|
|
|
|
|







