Package org.apache.maven.reporting
Class AbstractMavenReport
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.reporting.AbstractMavenReport
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.apache.maven.reporting.MavenMultiPageReport,org.apache.maven.reporting.MavenReport
public abstract class AbstractMavenReport
extends org.apache.maven.plugin.AbstractMojo
implements org.apache.maven.reporting.MavenMultiPageReport
The basis for a Maven report which can be generated both as part of a site generation or
as a direct standalone goal invocation.
Both invocations are delegated to
abstract executeReport( Locale ) from:
- Mojo's
execute()method, see maven-plugin-api - MavenMultiPageReport's
generate( Sink, SinkFactory, Locale ), see maven-reporting-api
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileThe output directory for the report.protected org.apache.maven.project.MavenProjectThe Maven Project.protected org.apache.maven.doxia.siterenderer.RendererDoxia Site Renderer component.Fields inherited from interface org.apache.maven.reporting.MavenReport
CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLEFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected voidActions when closing the report.voidexecute()This method is called when the report generation is invoked directly as a standalone Mojo.protected abstract voidexecuteReport(Locale locale) Execute the generation of the report.voidDeprecated.voidgenerate(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, Locale locale) This method is called when the report generation is invoked by maven-site-plugin.voidDeprecated.usegenerate(Sink, SinkFactory, Locale)instead.protected StringGets the input files encoding.protected Stringprotected StringGets the effective reporting output files encoding.protected org.apache.maven.project.MavenProjectorg.apache.maven.doxia.sink.SinkgetSink()org.apache.maven.doxia.sink.SinkFactoryprotected org.apache.maven.doxia.siterenderer.RendererbooleanvoidsetReportOutputDirectory(File reportOutputDirectory) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.reporting.MavenReport
getDescription, getName, getOutputName
-
Field Details
-
outputDirectory
@Parameter(defaultValue="${project.reporting.outputDirectory}", readonly=true, required=true) protected File outputDirectoryThe output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead. -
project
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject projectThe Maven Project. -
siteRenderer
@Component protected org.apache.maven.doxia.siterenderer.Renderer siteRendererDoxia Site Renderer component.
-
-
Constructor Details
-
AbstractMavenReport
public AbstractMavenReport()
-
-
Method Details
-
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:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionException- if an error occurs when generating the report- See Also:
-
Mojo.execute()
-
generate
@Deprecated public void generate(org.codehaus.doxia.sink.Sink sink, Locale locale) throws org.apache.maven.reporting.MavenReportException Deprecated.usegenerate(Sink, SinkFactory, Locale)instead.Generate a report.- Parameters:
sink- the sink to use for the generation.locale- the wanted locale to generate the report, could be null.- Throws:
org.apache.maven.reporting.MavenReportException- if any
-
generate
@Deprecated public void generate(org.apache.maven.doxia.sink.Sink sink, Locale locale) throws org.apache.maven.reporting.MavenReportException Deprecated.usegenerate(Sink, SinkFactory, Locale)instead.Generate a report.- Specified by:
generatein interfaceorg.apache.maven.reporting.MavenReport- Parameters:
sink-locale-- 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 This method is called when the report generation is invoked by maven-site-plugin.- Specified by:
generatein interfaceorg.apache.maven.reporting.MavenMultiPageReport- Parameters:
sink-sinkFactory-locale-- Throws:
org.apache.maven.reporting.MavenReportException
-
getCategoryName
- Specified by:
getCategoryNamein interfaceorg.apache.maven.reporting.MavenReport- Returns:
- CATEGORY_PROJECT_REPORTS
-
getReportOutputDirectory
- Specified by:
getReportOutputDirectoryin interfaceorg.apache.maven.reporting.MavenReport
-
setReportOutputDirectory
- Specified by:
setReportOutputDirectoryin interfaceorg.apache.maven.reporting.MavenReport
-
getOutputDirectory
-
getProject
protected org.apache.maven.project.MavenProject getProject() -
getSiteRenderer
protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer() -
getInputEncoding
Gets the input files encoding.- Returns:
- The input files encoding, never
null.
-
getOutputEncoding
Gets the effective reporting output files encoding.- Returns:
- The effective reporting output file encoding, never
null.
-
closeReport
protected void closeReport()Actions when closing the report. -
getSink
public org.apache.maven.doxia.sink.Sink getSink()- Returns:
- the sink used
-
getSinkFactory
public org.apache.maven.doxia.sink.SinkFactory getSinkFactory()- Returns:
- the sink factory used
-
isExternalReport
public boolean isExternalReport()- Specified by:
isExternalReportin interfaceorg.apache.maven.reporting.MavenReport- Returns:
falseby default.- See Also:
-
MavenReport.isExternalReport()
-
canGenerateReport
public boolean canGenerateReport()- Specified by:
canGenerateReportin interfaceorg.apache.maven.reporting.MavenReport
-
executeReport
protected abstract void executeReport(Locale locale) throws org.apache.maven.reporting.MavenReportException Execute the generation of the report.- Parameters:
locale- the wanted locale to return the report's description, could benull.- Throws:
org.apache.maven.reporting.MavenReportException- if any
-
generate(Sink, SinkFactory, Locale)instead.