Full name:
org.openclover:clover-maven-plugin:4.5.2:reset
Description:
Reset source directories to original ones.
Attributes:
| Name | Type | Since | Description |
|---|---|---|---|
<cloverMergeDatabase> |
String |
- |
The location of the merged clover database to create when running a report in a multimodule build. Default: ${project.build.directory}/clover/cloverMerge.dbUser Property: maven.clover.cloverMergeDatabase |
<cloverOutputDirectory> |
String |
- |
The directory where the Clover plugin will put all the files it generates during the build process. For example the Clover plugin will put instrumented sources somewhere inside this directory. Default: ${project.build.directory}/clover |
<pluginArtifacts> |
List<Artifact> |
- |
List of all artifacts for this Clover plugin provided by Maven. This is used internally to get a handle on the Clover JAR artifact. Note: This is passed by Maven and must not be configured by the user. Default: ${plugin.artifacts} |
<project> |
MavenProject |
- |
The Maven project instance for the executing project. Note: This is passed by Maven and must not be configured by the user. Default: ${project} |
| Name | Type | Since | Description |
|---|---|---|---|
<cloverDatabase> |
String |
- |
The location of the Clover database. User Property: maven.clover.cloverDatabase |
<cloveredArtifactExpiryInMillis> |
long |
- |
The difference (in milliseconds) that a -clover classified artifact can have to a non-clover classified artifact. If the -clover classified artifact is more than cloveredArtifactExpiryInMillis older than the non-clover classified artifact, then the non-classified artifact will be used. This setting defaults to 2000. Default: 2000User Property: maven.clover.cloveredArtifactExpiryInMillis |
<copyExcludedFiles> |
boolean |
- |
If set, then the clover-maven-plugin will not copy files that were excluded, across to the target/clover directory. This is useful if the build is also using plugins such as the maven-gwt-plugin, that scans for resources, and skips a step if none are found. Otherwise, setting this to false could well cause build failures. Default: trueUser Property: maven.clover.copyExcludedFiles |
<debug> |
boolean |
- |
If you wish to enable debug level logging in just the Clover plugin, set this to true. This is useful for integrating Clover into the build. Default: falseUser Property: maven.clover.debug |
<distributedCoverage> |
DistributedCoverage |
- |
The configuration for distributed coverage collection by Clover. If present, default values will be used and coverage will be collected across JVMs. Optional nested elements (and their defaults) of distributedCoverage are:
|
<encoding> |
String |
- |
The character encoding to use when parsing source files. User Property: maven.clover.encoding |
<excludes> |
Set<String> |
- |
The list of file to exclude from the instrumentation. Patterns are resolved against source roots. |
<excludesFile> |
String |
- |
The file containing a list of file paths, separated by new line, to exclude from the instrumentation. Patterns are resolved against source roots. See also com.atlassian.maven.plugin.clover.internal.AbstractCloverInstrumentMojo.excludes and com.atlassian.maven.plugin.clover.internal.AbstractCloverInstrumentMojo.excludesListUser Property: maven.clover.excludesFile |
<excludesList> |
String |
- |
The comma seperated list of file to exclude from the instrumentation. Patterns are resolved against source roots. User Property: maven.clover.excludesList |
<flushInterval> |
int |
- |
When the Clover Flush Policy is set to "interval" or threaded this value is the minimum period between flush operations (in milliseconds). Default: 500User Property: maven.clover.flushInterval |
<flushPolicy> |
String |
- |
The Clover flush policy to use. Valid values are directed, interval and threaded.Default: threadedUser Property: maven.clover.flushPolicy |
<groverJar> |
File |
3.1.8 |
By default, Clover Maven Plugin generates the By setting this parameter you can: a) specify constant file name for generated artifact, b) choose location different than ${java.io.tmpdir}. However, you must ensure that: a) grover.jar will not be deleted till end of the build (for example don't put into ./target directory and next run b) grover.jar will not be shared among builds with different Clover Maven Plugin versions used (for example if ProjectA uses Clover v 3.1.8 and ProjectB uses Clover v 3.1.9 then they shall have different User Property: maven.clover.groverJar |
<includes> |
Set<String> |
- |
The list of file to include in the instrumentation. Patterns are resolved against source roots. Defaults are '**/*.java, **/*.groovy' which are overwritten if <includes> is set by the user |
<includesAllSourceRoots> |
boolean |
- |
Till 3.1.11: whether the Clover plugin should instrument all source roots (for example Since 3.1.12: whether the Clover plugin should instrument all source roots (for example Default: falseUser Property: maven.clover.includesAllSourceRoots |
<includesFile> |
String |
- |
The file containing a list of file paths, separated by new line, to include in the instrumentation. Patterns are resolved against source roots. See also com.atlassian.maven.plugin.clover.internal.AbstractCloverInstrumentMojo.includes and com.atlassian.maven.plugin.clover.internal.AbstractCloverInstrumentMojo.includesListUser Property: maven.clover.includesFile |
<includesList> |
String |
- |
The comma seperated list of files to include in the instrumentation. Patterns are resolved against source roots. Defaults are **.java which are overwritten if <includes> is set by the user User Property: maven.clover.includesList |
<includesTestSourceRoots> |
boolean |
- |
Whether the Clover plugin should instrument test source roots. Default: trueUser Property: maven.clover.includesTestSourceRoots |
<instrumentation> |
String |
- |
The level to instrument to. Valid values are 'method' or 'statement'. Default is 'statement'. Setting this to 'method' greatly reduces the overhead of enabling Clover, however limited or no reporting is available. The current use of setting this to method is for Test Optimization only. Default: statementUser Property: maven.clover.instrumentation |
<instrumentLambda> |
String |
3.2.2 |
Define whether lambda functions shall be instrumented: Valid values are:
Default is 'all' for 3.2.2-4.0.2 and 'none' since 4.0.3. IMPORTANT: Due to Clover's restrictions related with code instrumentation and javac compiler's type inference capabilities, you may get compilation errors when expression-like lambda functions are passed to generic methods or types. In such case disable instrumentation of expression-like form (i.e. use the 'none' or 'block' setting). See the Java 8 code instrumented by Clover fails to compile Knowledge Base article for more details. Default: noneUser Property: maven.clover.instrumentLambda |
<jdk> |
String |
- |
Which Java language level Clover shall use to parse sources. Valid values are:
By default Clover instruments using the highest language level supported. User Property: maven.clover.jdk |
<license> |
String |
- |
The full Clover license String to use. If supplied, this certificate will be used over com.atlassian.maven.plugin.clover.internal.AbstractCloverMojo.licenseLocation. NB. newline chars must be preserved. If not provided, Clover will use a bundled license key.See also: com.atlassian.maven.plugin.clover.internal.AbstractCloverMojo.licenseLocation User Property: maven.clover.license |
<licenseLocation> |
String |
- |
A Clover license file to be used by the plugin. The plugin tries to resolve this parameter first as a resource, then as a URL, and then as a file location on the filesystem. If not provided, Clover will use a bundled license key. See also: com.atlassian.maven.plugin.clover.internal.AbstractCloverMojo.license User Property: maven.clover.licenseLocation |
<methodContexts> |
Map<String,String> |
- |
Specifies the custom method contexts to use for filtering specific methods from Clover reports. e.g.<main>public static void main\(String args\[\]\).*</main> will define the context called 'main' which will match all public static void main methods. |
<methodWithMetricsContexts> |
Set<MethodWithMetricsContext> |
- |
Specifies the custom method contexts to use for filtering specific methods from Clover reports. This is more detailed format compared to methodContexts, which allows to set also code metrics to be matched. Example:
<methodWithMetricsContexts>
<methodWithMetricsContext>
<name>simpleGetter</name> <!-- (mandatory) -->
<regexp>public .* get.*\(\)</regexp> <!-- (mandatory) -->
<maxComplexity>1</maxComplexity> <!-- at most 1 cycle (optional) -->
<maxStatements>1</maxStatements> <!-- at most 1 statement (optional) -->
<maxAggregatedComplexity>2</maxAggregatedComplexity> <!-- no more than 2 cycles including inline classes (optional) -->
<maxAggregatedStatements>10</maxAggregatedStatements> <!-- no more than 10 statements including inline classes (optional) -->
</methodWithMetricsContext>
<!-- can add more methodWithMetricsContext -->
</methodWithMetricsContexts>
will define a context called 'simpleGetter' which matches all public getXyz() methods containing at most one statement; this statement may contain more complex logic (an anonymous inline class) but not bigger than 9 statements. |
<recordTestResults> |
boolean |
- |
If set to 'false', test results will not be recorded; instead, results can be added via the <testResults> fileset at report time. Useful when a test uses a custom Rule expecting an exception, which OpenClover cannot recognize. Default: trueUser Property: maven.clover.recordTestResults |
<repositories> |
List<ArtifactRepository> |
- |
Remote repositories used for the project. Default: ${project.remoteArtifactRepositories} |
<repositoryPollutionProtection> |
boolean |
4.0.4 |
Try to protect your build from installing instrumented artifacts into local ~/.m2 cache or deploying them to a binaries repository. If this option is enabled, Clover will fail a build whenever it detects that 'install' or 'deploy' phase is about to be called. It will also fail a build if it detects that an artifact having multiple classifiers (e.g. "-clover-tests.jar"), which are not supported by Maven, is about to be installed under original name (e.g. "-tests.jar"). Please note that this flag may not protect from all possible cases. Default: falseUser Property: maven.clover.repositoryPollutionProtection |
<scope> |
String |
- |
When creating the clover.jar dependency, what scope to use. This may be one of: compile, test, provided etc. If not specified - provided will be used. User Property: maven.clover.scope |
<setTestFailureIgnore> |
boolean |
3.1.9 |
If set to
Thanks to this, build continues despite test failures or code validation failures and thus it is possible to generate a Clover coverage report for failed tests at the end of the build. Note: before version 3.1.9 the testFailureIgnore property was set to true for the forked Clover lifecycle ('instrument' goal) for 'test' and 'integration-test' phases. Since 3.1.9 it is no longer set. Default: falseUser Property: maven.clover.setTestFailureIgnore |
<singleCloverDatabase> |
boolean |
- |
If true, then a single cloverDatabase will be used for the entire project. This flag will be ignored if a custom cloverDatabase location is specified. Default: falseUser Property: maven.clover.singleCloverDatabase |
<skip> |
boolean |
- |
A flag to indicate not to run clover for this execution. If set to true, Clover will not be run. Default: falseUser Property: maven.clover.skip |
<skipGroverJar> |
boolean |
3.1.8 |
By default, Clover Maven Plugin generates the In case when there is no Groovy code in the project, this parameter can be set to Default: falseUser Property: maven.clover.skipGroverJar |
<snapshot> |
File |
- |
The location to store the clover snapshot file. This file needs to persist between builds to enable Clover's build optimization feature. If not specified, the snapshot will be stored next to the cloverDatabase. User Property: maven.clover.snapshot |
<staleMillis> |
int |
- |
Sets the granularity in milliseconds of the last modification date for testing whether a source needs reinstrumentation. Default: 0User Property: maven.clover.staleMillis |
<statementContexts> |
Map<String,String> |
- |
Specifies the custom statement contexts to use for filtering specific statements from Clover reports. e.g.
<log>^LOG\..*</log>defines a statement context called "log" which matches all LOG statements. |
<testSources> |
TestSources |
4.4.0 |
Specifies a custom test detector configuration. Useful in case your tests are not following JUnit/TestNG naming convention. Example:
<testSources>
<includes>
<include>**/*</include>
<include>*WebTest.java</include>
<include>**/*IT.java</include>
</includes>
<excludes>
<exclude>deprecated/**</exclude>
</excludes>
<testClasses>
<testClass> <!-- 0..N occurrences -->
<name>.*Test</name>
<super>WebTest</super>
<annotation>@Repeat</annotation>
<package>org\.openclover\..*</package>
<tag>@chrome</tag>
<testMethods> <!-- 0..N occurrences -->
<testMethod>
<name>check.*</name>
<annotation>@Test</annotation>
<tag>@web</tag>
<returnType>void</returnType>
</testMethod>
</testMethods>
</testClass>
</testClasses>
</testSources>
Note: every tag is optional. |
<useCloverClassifier> |
boolean |
- |
Whether or not to include the -clover classifier on artifacts. Default: trueUser Property: maven.clover.useCloverClassifier |
<useFullyQualifiedJavaLang> |
boolean |
- |
Use the fully qualified package name for java.lang.* classes. Default: trueUser Property: maven.clover.useFullyQualifiedJavaLang |
<waitForFlush> |
boolean |
- |
If true we'll wait 2*flushInterval to ensure coverage data is flushed to the Clover database before running any query on it. Note: The only use case where you would want to turn this off is if you're running your tests in a separate JVM. In that case the coverage data will be flushed by default upon the JVM shutdown and there would be no need to wait for the data to be flushed. As we can't control whether users want to fork their tests or not, we're offering this parameter to them. Default: trueUser Property: maven.clover.waitForFlush |
java.lang.Stringreport.plugin.goal.nomaven.clover.cloverDatabaseThe difference (in milliseconds) that a -clover classified artifact can have to a non-clover classified artifact.
If the -clover classified artifact is more than cloveredArtifactExpiryInMillis older than the non-clover classified artifact, then the non-classified artifact will be used.
This setting defaults to 2000.
longreport.plugin.goal.nomaven.clover.cloveredArtifactExpiryInMillis2000java.lang.Stringreport.plugin.goal.yesmaven.clover.cloverMergeDatabase${project.build.directory}/clover/cloverMerge.dbjava.lang.Stringreport.plugin.goal.yes${project.build.directory}/cloverbooleanreport.plugin.goal.nomaven.clover.copyExcludedFilestruebooleanreport.plugin.goal.nomaven.clover.debugfalseThe configuration for distributed coverage collection by Clover.
If present, default values will be used and coverage will be collected across JVMs.
Optional nested elements (and their defaults) of distributedCoverage are:
com.atlassian.maven.plugin.clover.DistributedCoveragereport.plugin.goal.nojava.lang.Stringreport.plugin.goal.nomaven.clover.encodingjava.util.Set<java.lang.String>report.plugin.goal.nocom.atlassian.maven.plugin.clover.internal.AbstractCloverInstrumentMojo.excludes and com.atlassian.maven.plugin.clover.internal.AbstractCloverInstrumentMojo.excludesListjava.lang.Stringreport.plugin.goal.nomaven.clover.excludesFilejava.lang.Stringreport.plugin.goal.nomaven.clover.excludesListintreport.plugin.goal.nomaven.clover.flushInterval500java.lang.Stringreport.plugin.goal.nomaven.clover.flushPolicythreadedBy default, Clover Maven Plugin generates the ${java.io.tmpdir}/grover*.jar file during setup, which is next being added as the dependent artifact to the build. As the file has generated, unique name and the jar is not being removed at the end of the build, these files can litter the temporary directory.
By setting this parameter you can:
a) specify constant file name for generated artifact,
b) choose location different than ${java.io.tmpdir}.
However, you must ensure that:
a) grover.jar will not be deleted till end of the build (for example don't put into ./target directory and next run mvn clover:setup clean)
b) grover.jar will not be shared among builds with different Clover Maven Plugin versions used (for example if ProjectA uses Clover v 3.1.8 and ProjectB uses Clover v 3.1.9 then they shall have different groverJar locations defined)
java.io.File3.1.8report.plugin.goal.nomaven.clover.groverJarjava.util.Set<java.lang.String>report.plugin.goal.noTill 3.1.11: whether the Clover plugin should instrument all source roots (for example src/main/java, src/main/groovy, target/generated-sources, so including the generated sources) or whether it should only instrument the main source root (usually src/main/java).
Since 3.1.12: whether the Clover plugin should instrument all source roots (for example src/main/java, src/main/groovy, target/generated-sources, so including the generated sources) or whether it should instrument non-generated source roots (i.e. all roots except target/generated-sources/*)
booleanreport.plugin.goal.nomaven.clover.includesAllSourceRootsfalsecom.atlassian.maven.plugin.clover.internal.AbstractCloverInstrumentMojo.includes and com.atlassian.maven.plugin.clover.internal.AbstractCloverInstrumentMojo.includesListjava.lang.Stringreport.plugin.goal.nomaven.clover.includesFilejava.lang.Stringreport.plugin.goal.nomaven.clover.includesListbooleanreport.plugin.goal.nomaven.clover.includesTestSourceRootstrueThe level to instrument to. Valid values are 'method' or 'statement'. Default is 'statement'.
Setting this to 'method' greatly reduces the overhead of enabling Clover, however limited or no reporting is available. The current use of setting this to method is for Test Optimization only.
java.lang.Stringreport.plugin.goal.nomaven.clover.instrumentationstatementDefine whether lambda functions shall be instrumented: Valid values are:
(a,b) -> a + b() -> { foo(); }Math::absDefault is 'all' for 3.2.2-4.0.2 and 'none' since 4.0.3.
IMPORTANT: Due to Clover's restrictions related with code instrumentation and javac compiler's type inference capabilities, you may get compilation errors when expression-like lambda functions are passed to generic methods or types. In such case disable instrumentation of expression-like form (i.e. use the 'none' or 'block' setting). See the Java 8 code instrumented by Clover fails to compile Knowledge Base article for more details.
java.lang.String3.2.2report.plugin.goal.nomaven.clover.instrumentLambdanoneWhich Java language level Clover shall use to parse sources. Valid values are:
By default Clover instruments using the highest language level supported.
java.lang.Stringreport.plugin.goal.nomaven.clover.jdkcom.atlassian.maven.plugin.clover.internal.AbstractCloverMojo.licenseLocation. NB. newline chars must be preserved. If not provided, Clover will use a bundled license key.java.lang.Stringreport.plugin.goal.nomaven.clover.licensejava.lang.Stringreport.plugin.goal.nomaven.clover.licenseLocationSpecifies the custom method contexts to use for filtering specific methods from Clover reports.
e.g.<main>public static void main\(String args\[\]\).*</main>
will define the context called 'main' which will match all public static void main methods.
java.util.Map<java.lang.String, java.lang.String>report.plugin.goal.noSpecifies the custom method contexts to use for filtering specific methods from Clover reports. This is more detailed format compared to methodContexts, which allows to set also code metrics to be matched. Example:
<methodWithMetricsContexts>
<methodWithMetricsContext>
<name>simpleGetter</name> <!-- (mandatory) -->
<regexp>public .* get.*\(\)</regexp> <!-- (mandatory) -->
<maxComplexity>1</maxComplexity> <!-- at most 1 cycle (optional) -->
<maxStatements>1</maxStatements> <!-- at most 1 statement (optional) -->
<maxAggregatedComplexity>2</maxAggregatedComplexity> <!-- no more than 2 cycles including inline classes (optional) -->
<maxAggregatedStatements>10</maxAggregatedStatements> <!-- no more than 10 statements including inline classes (optional) -->
</methodWithMetricsContext>
<!-- can add more methodWithMetricsContext -->
</methodWithMetricsContexts>
will define a context called 'simpleGetter' which matches all public getXyz() methods containing at most one statement; this statement may contain more complex logic (an anonymous inline class) but not bigger than 9 statements.
java.util.Set<com.atlassian.maven.plugin.clover.MethodWithMetricsContext>report.plugin.goal.noList of all artifacts for this Clover plugin provided by Maven. This is used internally to get a handle on the Clover JAR artifact.
Note: This is passed by Maven and must not be configured by the user.
java.util.List<org.apache.maven.artifact.Artifact>report.plugin.goal.yes${plugin.artifacts}The Maven project instance for the executing project.
Note: This is passed by Maven and must not be configured by the user.
org.apache.maven.project.MavenProjectreport.plugin.goal.yes${project}booleanreport.plugin.goal.nomaven.clover.recordTestResultstruejava.util.List<org.apache.maven.artifact.repository.ArtifactRepository>report.plugin.goal.no${project.remoteArtifactRepositories}Try to protect your build from installing instrumented artifacts into local ~/.m2 cache or deploying them to a binaries repository. If this option is enabled, Clover will fail a build whenever it detects that 'install' or 'deploy' phase is about to be called. It will also fail a build if it detects that an artifact having multiple classifiers (e.g. "-clover-tests.jar"), which are not supported by Maven, is about to be installed under original name (e.g. "-tests.jar").
Please note that this flag may not protect from all possible cases.
boolean4.0.4report.plugin.goal.nomaven.clover.repositoryPollutionProtectionfalsejava.lang.Stringreport.plugin.goal.nomaven.clover.scopeIf set to true, Clover will add several properties to the build configuration which disable a build failure for following plugins:
Thanks to this, build continues despite test failures or code validation failures and thus it is possible to generate a Clover coverage report for failed tests at the end of the build.
Note: before version 3.1.9 the testFailureIgnore property was set to true for the forked Clover lifecycle ('instrument' goal) for 'test' and 'integration-test' phases. Since 3.1.9 it is no longer set.
boolean3.1.9report.plugin.goal.nomaven.clover.setTestFailureIgnorefalsebooleanreport.plugin.goal.nomaven.clover.singleCloverDatabasefalsebooleanreport.plugin.goal.nomaven.clover.skipfalseBy default, Clover Maven Plugin generates the ${java.io.tmpdir}/grover*.jar file during setup, which is next being added as the dependent artifact to the build. As the file has generated, unique name and the jar is not being removed at the end of the build, these files can litter the temporary directory.
In case when there is no Groovy code in the project, this parameter can be set to true in order to disable generation of grover.jar artifact.
boolean3.1.8report.plugin.goal.nomaven.clover.skipGroverJarfalsejava.io.Filereport.plugin.goal.nomaven.clover.snapshotintreport.plugin.goal.nomaven.clover.staleMillis0<log>^LOG\..*</log>defines a statement context called "log" which matches all LOG statements.
java.util.Map<java.lang.String, java.lang.String>report.plugin.goal.no
<testSources>
<includes>
<include>**/*</include>
<include>*WebTest.java</include>
<include>**/*IT.java</include>
</includes>
<excludes>
<exclude>deprecated/**</exclude>
</excludes>
<testClasses>
<testClass> <!-- 0..N occurrences -->
<name>.*Test</name>
<super>WebTest</super>
<annotation>@Repeat</annotation>
<package>org\.openclover\..*</package>
<tag>@chrome</tag>
<testMethods> <!-- 0..N occurrences -->
<testMethod>
<name>check.*</name>
<annotation>@Test</annotation>
<tag>@web</tag>
<returnType>void</returnType>
</testMethod>
</testMethods>
</testClass>
</testClasses>
</testSources>
Note: every tag is optional.com.atlassian.maven.plugin.clover.TestSources4.4.0report.plugin.goal.nobooleanreport.plugin.goal.nomaven.clover.useCloverClassifiertruebooleanreport.plugin.goal.nomaven.clover.useFullyQualifiedJavaLangtrueIf true we'll wait 2*flushInterval to ensure coverage data is flushed to the Clover database before running any query on it.
Note: The only use case where you would want to turn this off is if you're running your tests in a separate JVM. In that case the coverage data will be flushed by default upon the JVM shutdown and there would be no need to wait for the data to be flushed. As we can't control whether users want to fork their tests or not, we're offering this parameter to them.
booleanreport.plugin.goal.nomaven.clover.waitForFlushtrue