public abstract class AbstractCloverMojo extends org.apache.maven.plugin.AbstractMojo implements CloverConfiguration
| Modifier and Type | Field and Description |
|---|---|
protected String |
cloverOutputDirectory
The directory where the Clover plugin will put all the files it generates during the build process.
|
protected boolean |
debug
If you wish to enable debug level logging in just the Clover plugin, set this to true.
|
protected String |
license
The full Clover license String to use.
|
protected String |
licenseLocation
A Clover license file to be used by the plugin.
|
protected boolean |
skip
A flag to indicate not to run clover for this execution.
|
protected File |
snapshot
The location to store the clover snapshot file.
|
| Constructor and Description |
|---|
AbstractCloverMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
areCloverDatabasesAvailable()
Check if a Clover database exists (either a single module Clover database or an aggregated one).
|
void |
execute() |
String |
getCloverDatabase() |
protected String |
getCloverMergeDatabase() |
protected List<org.apache.maven.project.MavenProject> |
getDescendantModuleProjects(org.apache.maven.project.MavenProject project)
returns all the projects that are in the reactor build as
direct or indirect modules of the specified project.
|
int |
getFlushInterval() |
protected List<org.apache.maven.project.MavenProject> |
getModuleProjects(org.apache.maven.project.MavenProject project,
int levels)
Returns all the projects that are modules, or modules of modules, of the
specified project found within the reactor.
|
org.apache.maven.project.MavenProject |
getProject() |
List<org.apache.maven.project.MavenProject> |
getReactorProjects() |
static File |
getResourceAsFile(String resourceLocation,
org.apache.maven.plugin.logging.Log logger,
ClassLoader classloader) |
boolean |
getWaitForFlush() |
protected boolean |
isLastProjectInReactor() |
protected boolean |
isModuleOfProject(org.apache.maven.project.MavenProject parentProject,
org.apache.maven.project.MavenProject potentialModule)
Returns true if the supplied potentialModule project is a module
of the specified parentProject.
|
boolean |
isSingleCloverDatabase() |
static void |
registerCloverAntTasks(org.apache.tools.ant.Project antProject,
org.apache.maven.plugin.logging.Log log)
Register the Clover Ant tasks against a fake Ant {
Project} object so that we can the tasks later on. |
String |
resolveCloverDatabase() |
void |
setLicense(String license) |
void |
setLicenseLocation(String licenseLocation) |
void |
setProject(org.apache.maven.project.MavenProject project) |
static void |
waitForFlush(boolean waitForFlush,
int flushInterval)
Wait 2*'flush interval' milliseconds to ensure that the coverage data have been flushed to the Clover database.
|
getLog, getPluginContext, setLog, setPluginContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLog@Parameter(defaultValue="${project.build.directory}/clover",
required=true)
protected String cloverOutputDirectory
@Parameter(property="maven.clover.snapshot") protected File snapshot
@Parameter(property="maven.clover.licenseLocation") protected String licenseLocation
license@Parameter(property="maven.clover.license") protected String license
licenseLocation.
NB. newline chars must be preserved. If not provided, Clover will use a bundled license key.licenseLocation@Parameter(property="maven.clover.skip",
defaultValue="false")
protected boolean skip
@Parameter(property="maven.clover.debug",
defaultValue="false")
protected boolean debug
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
execute in interface org.apache.maven.plugin.Mojoorg.apache.maven.plugin.MojoExecutionExceptionMojo.execute()public static File getResourceAsFile(String resourceLocation, org.apache.maven.plugin.logging.Log logger, ClassLoader classloader) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic static void registerCloverAntTasks(org.apache.tools.ant.Project antProject,
org.apache.maven.plugin.logging.Log log)
Project} object so that we can the tasks later on.
This is the Java equivalent of the taskdef call that you would need in your Ant
build.xml file if you wanted to use the Clover Ant tasks from Ant.
Note: We're defining this method as static because it is also required in the report mojo and reporting mojos
and main mojos cannot share anything right now. See http://jira.codehaus.org/browse/MNG-1886.antProject - projectlog - loggerpublic static void waitForFlush(boolean waitForFlush,
int flushInterval)
waitForFlush - whether to pause until flush occursflushInterval - current intervalprotected boolean areCloverDatabasesAvailable()
public org.apache.maven.project.MavenProject getProject()
getProject in interface CloverConfigurationpublic boolean getWaitForFlush()
public String getCloverDatabase()
getCloverDatabase in interface CloverConfigurationpublic String resolveCloverDatabase()
resolveCloverDatabase in interface CloverConfigurationprotected String getCloverMergeDatabase()
public int getFlushInterval()
public void setProject(org.apache.maven.project.MavenProject project)
public void setLicenseLocation(String licenseLocation)
public void setLicense(String license)
public List<org.apache.maven.project.MavenProject> getReactorProjects()
getReactorProjects in interface CloverConfigurationpublic boolean isSingleCloverDatabase()
isSingleCloverDatabase in interface CloverConfigurationprotected boolean isLastProjectInReactor()
protected boolean isModuleOfProject(org.apache.maven.project.MavenProject parentProject,
org.apache.maven.project.MavenProject potentialModule)
parentProject - the parent project.potentialModule - the potential moduleproject.protected List<org.apache.maven.project.MavenProject> getModuleProjects(org.apache.maven.project.MavenProject project, int levels)
project - the project to search underlevels - the number of descendent levels to return (List<MavenProject>)protected List<org.apache.maven.project.MavenProject> getDescendantModuleProjects(org.apache.maven.project.MavenProject project)
project - the project to search beneathCopyright © 2019 OpenClover.org. All rights reserved.