Package org.jacoco.maven
Class AbstractReportMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.jacoco.maven.AbstractReportMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
,org.apache.maven.reporting.MavenMultiPageReport
,org.apache.maven.reporting.MavenReport
- Direct Known Subclasses:
ReportAggregateMojo
,ReportITMojo
,ReportMojo
public abstract class AbstractReportMojo
extends org.apache.maven.plugin.AbstractMojo
implements org.apache.maven.reporting.MavenMultiPageReport
Base class for creating a code coverage report for tests of a single project
in multiple formats (HTML, XML, and CSV).
-
Field Summary
FieldsModifier and TypeFieldDescriptionA list of class files to exclude from the report.(package private) String
Footer text used in HTML report pages.(package private) List
<ReportFormat> A list of report formats to generate.A list of class files to include in the report.(package private) String
Encoding of the generated reports.(package private) org.apache.maven.project.MavenProject
Maven project.(package private) boolean
Flag used to suppress execution.(package private) String
Encoding of the source files.(package private) String
Name of the root node HTML report pages.Fields inherited from interface org.apache.maven.reporting.MavenReport
CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLE
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addFormatters
(ReportSupport support, Locale locale) boolean
(package private) abstract boolean
(package private) abstract boolean
(package private) abstract void
createReport
(IReportGroupVisitor visitor, ReportSupport support) void
execute()
This method is called when the report generation is invoked directly as a standalone Mojo.private void
executeReport
(Locale locale) void
void
generate
(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, Locale locale) getDescription
(Locale locale) Returns the list of class files to exclude from the report.Returns the list of class files to include in the report.(package private) abstract File
boolean
(package private) abstract void
loadExecutionData
(ReportSupport support) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.reporting.MavenReport
getName, getOutputName, getOutputPath, getReportOutputDirectory, setReportOutputDirectory
-
Field Details
-
outputEncoding
Encoding of the generated reports. -
formats
A list of report formats to generate. Supported formats are HTML, XML and CSV. Defaults to all formats if no values are given.- Since:
- 0.8.7
-
title
Name of the root node HTML report pages.- Since:
- 0.7.7
-
sourceEncoding
Encoding of the source files. -
includes
A list of class files to include in the report. May use wildcard characters (* and ?). When not specified everything will be included. -
excludes
A list of class files to exclude from the report. May use wildcard characters (* and ?). When not specified nothing will be excluded. -
skip
@Parameter(property="jacoco.skip", defaultValue="false") boolean skipFlag used to suppress execution. -
project
@Parameter(property="project", readonly=true) org.apache.maven.project.MavenProject projectMaven project.
-
-
Constructor Details
-
AbstractReportMojo
public AbstractReportMojo()
-
-
Method Details
-
getDescription
- Specified by:
getDescription
in interfaceorg.apache.maven.reporting.MavenReport
-
isExternalReport
public boolean isExternalReport()- Specified by:
isExternalReport
in interfaceorg.apache.maven.reporting.MavenReport
-
getCategoryName
- Specified by:
getCategoryName
in interfaceorg.apache.maven.reporting.MavenReport
-
getIncludes
Returns the list of class files to include in the report.- Returns:
- class files to include, may contain wildcard characters
-
getExcludes
Returns the list of class files to exclude from the report.- Returns:
- class files to exclude, may contain wildcard characters
-
canGenerateReport
public boolean canGenerateReport()- Specified by:
canGenerateReport
in interfaceorg.apache.maven.reporting.MavenReport
-
canGenerateReportRegardingDataFiles
abstract boolean canGenerateReportRegardingDataFiles() -
canGenerateReportRegardingClassesDirectory
abstract boolean canGenerateReportRegardingClassesDirectory() -
getOutputDirectory
-
generate
public void generate(org.apache.maven.doxia.sink.Sink sink, Locale locale) throws org.apache.maven.reporting.MavenReportException - Specified by:
generate
in interfaceorg.apache.maven.reporting.MavenReport
- Throws:
org.apache.maven.reporting.MavenReportException
-
generate
public void generate(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, Locale locale) throws org.apache.maven.reporting.MavenReportException - Specified by:
generate
in interfaceorg.apache.maven.reporting.MavenMultiPageReport
- Throws:
org.apache.maven.reporting.MavenReportException
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionThis method is called when the report generation is invoked directly as a standalone Mojo.- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
executeReport
- Throws:
org.apache.maven.reporting.MavenReportException
-
addFormatters
- Throws:
IOException
-
loadExecutionData
- Throws:
IOException
-
createReport
- Throws:
IOException
-