Package org.jacoco.maven
Class ReportMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.reporting.AbstractMavenReport
-
- org.jacoco.maven.AbstractReportMojo
-
- org.jacoco.maven.ReportMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
,org.apache.maven.reporting.MavenMultiPageReport
,org.apache.maven.reporting.MavenReport
@Mojo(name="report", defaultPhase=VERIFY, threadSafe=true) public class ReportMojo extends AbstractReportMojo
Creates a code coverage report for tests of a single project in multiple formats (HTML, XML, and CSV).- Since:
- 0.5.3
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
dataFile
File with execution data.private java.io.File
outputDirectory
Output directory for the reports.-
Fields inherited from class org.jacoco.maven.AbstractReportMojo
excludes, footer, includes, outputEncoding, project, siteRenderer, skip, sourceEncoding, title
-
-
Constructor Summary
Constructors Constructor Description ReportMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addFormatters(ReportSupport support, java.util.Locale locale)
(package private) boolean
canGenerateReportRegardingClassesDirectory()
(package private) boolean
canGenerateReportRegardingDataFiles()
(package private) void
createReport(IReportGroupVisitor visitor, ReportSupport support)
java.lang.String
getName(java.util.Locale locale)
protected java.lang.String
getOutputDirectory()
java.lang.String
getOutputName()
(package private) void
loadExecutionData(ReportSupport support)
void
setReportOutputDirectory(java.io.File reportOutputDirectory)
-
Methods inherited from class org.jacoco.maven.AbstractReportMojo
canGenerateReport, execute, executeReport, getDescription, getExcludes, getIncludes, getProject, getSiteRenderer, isExternalReport
-
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
closeReport, generate, generate, generate, getCategoryName, getInputEncoding, getOutputEncoding, getReportOutputDirectory, getSink, getSinkFactory
-
-
-
-
Field Detail
-
outputDirectory
@Parameter(defaultValue="${project.reporting.outputDirectory}/jacoco") private java.io.File outputDirectory
Output directory for the reports. Note that this parameter is only relevant if the goal is run from the command line or from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.
-
dataFile
@Parameter(property="jacoco.dataFile", defaultValue="${project.build.directory}/jacoco.exec") private java.io.File dataFile
File with execution data.
-
-
Method Detail
-
canGenerateReportRegardingDataFiles
boolean canGenerateReportRegardingDataFiles()
- Specified by:
canGenerateReportRegardingDataFiles
in classAbstractReportMojo
-
canGenerateReportRegardingClassesDirectory
boolean canGenerateReportRegardingClassesDirectory()
- Specified by:
canGenerateReportRegardingClassesDirectory
in classAbstractReportMojo
-
loadExecutionData
void loadExecutionData(ReportSupport support) throws java.io.IOException
- Specified by:
loadExecutionData
in classAbstractReportMojo
- Throws:
java.io.IOException
-
addFormatters
void addFormatters(ReportSupport support, java.util.Locale locale) throws java.io.IOException
- Specified by:
addFormatters
in classAbstractReportMojo
- Throws:
java.io.IOException
-
createReport
void createReport(IReportGroupVisitor visitor, ReportSupport support) throws java.io.IOException
- Specified by:
createReport
in classAbstractReportMojo
- Throws:
java.io.IOException
-
getOutputDirectory
protected java.lang.String getOutputDirectory()
- Overrides:
getOutputDirectory
in classorg.apache.maven.reporting.AbstractMavenReport
-
setReportOutputDirectory
public void setReportOutputDirectory(java.io.File reportOutputDirectory)
- Specified by:
setReportOutputDirectory
in interfaceorg.apache.maven.reporting.MavenReport
- Overrides:
setReportOutputDirectory
in classorg.apache.maven.reporting.AbstractMavenReport
-
getOutputName
public java.lang.String getOutputName()
-
getName
public java.lang.String getName(java.util.Locale locale)
-
-