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
Fields Modifier and Type Field Description (package private) java.util.List<java.lang.String>
excludes
A list of class files to exclude from the report.(package private) java.lang.String
footer
Footer text used in HTML report pages.(package private) java.util.List<ReportFormat>
formats
A list of report formats to generate.(package private) java.util.List<java.lang.String>
includes
A list of class files to include in the report.(package private) java.lang.String
outputEncoding
Encoding of the generated reports.(package private) org.apache.maven.project.MavenProject
project
Maven project.(package private) boolean
skip
Flag used to suppress execution.(package private) java.lang.String
sourceEncoding
Encoding of the source files.(package private) java.lang.String
title
Name of the root node HTML report pages.
-
Constructor Summary
Constructors Constructor Description AbstractReportMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private void
addFormatters(ReportSupport support, java.util.Locale locale)
boolean
canGenerateReport()
(package private) abstract boolean
canGenerateReportRegardingClassesDirectory()
(package private) abstract boolean
canGenerateReportRegardingDataFiles()
(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(java.util.Locale locale)
void
generate(org.apache.maven.doxia.sink.Sink sink, java.util.Locale locale)
void
generate(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, java.util.Locale locale)
java.lang.String
getCategoryName()
java.lang.String
getDescription(java.util.Locale locale)
(package private) java.util.List<java.lang.String>
getExcludes()
Returns the list of class files to exclude from the report.(package private) java.util.List<java.lang.String>
getIncludes()
Returns the list of class files to include in the report.(package private) abstract java.io.File
getOutputDirectory()
boolean
isExternalReport()
(package private) abstract void
loadExecutionData(ReportSupport support)
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
outputEncoding
@Parameter(property="project.reporting.outputEncoding", defaultValue="UTF-8") java.lang.String outputEncoding
Encoding of the generated reports.
-
formats
@Parameter(defaultValue="HTML,XML,CSV") java.util.List<ReportFormat> 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
@Parameter(defaultValue="${project.name}") java.lang.String title
Name of the root node HTML report pages.- Since:
- 0.7.7
-
footer
@Parameter java.lang.String footer
Footer text used in HTML report pages.- Since:
- 0.7.7
-
sourceEncoding
@Parameter(property="project.build.sourceEncoding", defaultValue="UTF-8") java.lang.String sourceEncoding
Encoding of the source files.
-
includes
@Parameter java.util.List<java.lang.String> includes
A list of class files to include in the report. May use wildcard characters (* and ?). When not specified everything will be included.
-
excludes
@Parameter java.util.List<java.lang.String> 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 skip
Flag used to suppress execution.
-
project
@Parameter(property="project", readonly=true) org.apache.maven.project.MavenProject project
Maven project.
-
-
Method Detail
-
getDescription
public java.lang.String getDescription(java.util.Locale locale)
- Specified by:
getDescription
in interfaceorg.apache.maven.reporting.MavenReport
-
isExternalReport
public boolean isExternalReport()
- Specified by:
isExternalReport
in interfaceorg.apache.maven.reporting.MavenReport
-
getCategoryName
public java.lang.String getCategoryName()
- Specified by:
getCategoryName
in interfaceorg.apache.maven.reporting.MavenReport
-
getIncludes
java.util.List<java.lang.String> getIncludes()
Returns the list of class files to include in the report.- Returns:
- class files to include, may contain wildcard characters
-
getExcludes
java.util.List<java.lang.String> 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
abstract java.io.File getOutputDirectory()
-
generate
public void generate(org.apache.maven.doxia.sink.Sink sink, java.util.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, java.util.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.MojoExecutionException
This 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
private void executeReport(java.util.Locale locale) throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
addFormatters
private void addFormatters(ReportSupport support, java.util.Locale locale) throws java.io.IOException
- Throws:
java.io.IOException
-
loadExecutionData
abstract void loadExecutionData(ReportSupport support) throws java.io.IOException
- Throws:
java.io.IOException
-
createReport
abstract void createReport(IReportGroupVisitor visitor, ReportSupport support) throws java.io.IOException
- Throws:
java.io.IOException
-
-