Here are the main features of the Maven plugin:
- Easy recording of build tests executed during Maven build process.
- Scan of your built artifacts.
- Upload of scan and build tests footprints.
- Maven 3.0 or higher
Use a dedicated profile
You are strongly recommended to define a custom profile for definitions related to this plugin. Indeed, our analysis should not be launched for each build but for specific environments and/or specific times. For example, developers will not launch Coverity Test Advisor - QA Edition from their IDE (for example, Eclipse), but our analysis will be activated on the Continuous Integration server (for example, Jenkins).
The Maven plugin is hosted in a dedicated Maven repository: http://maven.kalistick.com/content/groups/public/. Also, the plugin is able to download the Recorder, which is also hosted in this Maven repository. You have to declare the repository in your
.m2/settings.xml or in your POM, e.g. using a dedicated profile:
Here is a typical declaration to configure the plugin:
Our plugin uses the Recorder standard configuration (see app.conf). This file is loaded from following locations:
src/kalistick/app.confinside current Maven module
src/kalistick/app.confinside root Maven module
conf/app.confinside the Recorder root directory (
You can also define a specific location using "
confFile" property in plugin configuration.
However plugin must be configured with additional properties at Maven level, e.g.:
- credentials for connection to the Test Advisor Cockpit
- version of Recorder to download
Technical documentation about all properties available for plugin is provided in Maven generated plugin site: http://maven.kalistick.com/content/sites/kalistick-recorder-plugin/
Link with the Recorder
Our plugin does not embed the Recorder to avoid restricting it to a specific version. You have to provide an installation of Recorder for the Maven plugin. Two strategies are available:
- Let the Maven plugin automatically download the Recorder.
- Point to an existing installation.
This makes setup easier as it prevents you from installing Recorder as prerequisite. You just have to specify the version of Recorder to download, and optionally a destination path using
recorderHome property (by default in your
Note: Recorder is downloaded from the same Maven repository as the plugin. This allows you to mirror download using a corporate repository manager (e.g. Nexus).
This solution allows you to keep full control of the Recorder installation. You have to point to an existing directory through the
recorderHome property. In this case, you don't have to specify the Recorder version, but you have to define
<recorderAutoDownload>false</recorderAutoDownload> in plugin configuration to prevent automatic download.
Most of our customers projects are multi-modules. Our analysis will be performed for each child module, but will use the same configuration file. Also the scan will be built at the end of build, once all children modules are finished.
Plugin provides 4 goals:
- prepare-tests: prepare build test process to record test execution.
- scan: launch scan on packaged delivery.
- upload: upload content to Test Advisor Cockpit.
- dump: generate a dump for the Coverity Support team.
You can bind plugin goals to Maven phases (as defined above), and/or launch directly plugin's goals, e.g.
mvn kalistick-recorder:scan -Dkalistick.releaseName=1.0-test -Pkalistick.
Technical documentation of each goal is available in Maven generated plugin site: http://maven.kalistick.com/content/sites/kalistick-recorder-plugin/
This goal only intends to build the configuration variable which should be injected in processes to capture test footprints through the Agent.
The generated variable is named by default "kalistick.agent.jvmargs" but you can choose another name. It should be passed to all processes executing tests which should be captured. This includes plugins such as surefire (unit tests) or failsafe (integration tests). Should you want capture test processes launched in another way (e.g. through antrun plugin), just inject this variable as JVM options into the process definitions.
See http://maven.kalistick.com/content/sites/kalistick-recorder-plugin/prepare-tests-mojo.html for technical details.
This goal generates the scan file, in the same way as the Scanner does through command line. The scan must be launched once all Maven packages are generated.
Scan is named from the Maven project version but you are able to configure goal to use another value. *
See http://maven.kalistick.com/content/sites/kalistick-recorder-plugin/scan-mojo.html for technical details.
This goal is in charge of uploading scan and/or test footprint files to the Test Advisor Cockpit. Of course, it must be invoked after scan and test footprints have been generated.
Selection of files to upload may be configured, but by default, all generated Coverity Test Advisor - QA Edition files will be uploaded.
This goal aims to gather technical information to help the support team to resolve your problem. You should invoke this goal only through command line, using
mvn kalistick-recorder:dump -Pkalistick (path of generated file will be displayed).
See http://maven.kalistick.com/content/sites/kalistick-recorder-plugin/dump-mojo.html for technical details.
Check also the Maven Plugin FAQ.