public abstract class AbstractMavenReport
extends org.apache.maven.plugin.AbstractMojo
implements org.apache.maven.reporting.MavenMultiPageReport
abstract executeReport( Locale )
from:
execute()
method, see maven-plugin-apigenerate( Sink, SinkFactory, Locale )
, see maven-reporting-apiModifier and Type | Field and Description |
---|---|
protected String |
locale
The locale to use when the report generation is invoked directly as a standalone Mojo.
|
protected org.apache.maven.plugin.MojoExecution |
mojoExecution
The mojo execution
|
protected File |
outputDirectory
The shared output directory for the report.
|
protected String |
outputFormat
The report output format: null by default, to represent a site, but can be configured to a Doxia Sink id.
|
protected String |
outputTimestamp
Timestamp for reproducible output archive entries, either formatted as ISO 8601
yyyy-MM-dd'T'HH:mm:ssXXX or as an int representing seconds since the epoch (like
SOURCE_DATE_EPOCH). |
protected org.apache.maven.project.MavenProject |
project
The Maven Project.
|
protected List<org.apache.maven.project.MavenProject> |
reactorProjects
The reactor projects.
|
protected List<org.eclipse.aether.repository.RemoteRepository> |
remoteProjectRepositories
Remote project repositories used for the project.
|
protected org.eclipse.aether.RepositorySystemSession |
repoSession
The repository system session.
|
protected File |
siteDirectory
Directory containing the
site.xml file. |
protected org.apache.maven.doxia.siterenderer.Renderer |
siteRenderer
Doxia Site Renderer component.
|
protected org.apache.maven.doxia.tools.SiteTool |
siteTool
SiteTool.
|
Constructor and Description |
---|
AbstractMavenReport() |
Modifier and Type | Method and Description |
---|---|
boolean |
canGenerateReport() |
protected void |
closeReport()
Actions when closing the report.
|
protected String |
constructXrefLocation(File location,
boolean test)
Contructs the (Test) Source XRef location relative to the
getReportOutputDirectory()
with getXrefLocation(File, boolean) . |
void |
execute()
This method is called when the report generation is invoked directly as a standalone Mojo.
|
protected abstract void |
executeReport(Locale locale)
Execute the generation of the report.
|
void |
generate(org.apache.maven.doxia.sink.Sink sink,
Locale locale)
Deprecated.
use
generate(Sink, SinkFactory, Locale) instead. |
void |
generate(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.
|
String |
getCategoryName() |
protected String |
getInputEncoding()
Gets the input files encoding.
|
protected Locale |
getLocale()
Gets the locale
|
protected String |
getOutputDirectory() |
protected String |
getOutputEncoding()
Gets the effective reporting output files encoding.
|
protected org.apache.maven.project.MavenProject |
getProject() |
File |
getReportOutputDirectory() |
org.apache.maven.doxia.sink.Sink |
getSink() |
org.apache.maven.doxia.sink.SinkFactory |
getSinkFactory() |
protected org.apache.maven.doxia.siterenderer.Renderer |
getSiteRenderer() |
protected File |
getXrefLocation(File location,
boolean test)
Returns the (Test) Source XRef location as passthrough if provided, otherwise returns the
default value.
|
boolean |
isExternalReport() |
void |
setReportOutputDirectory(File reportOutputDirectory) |
getLog, getPluginContext, setLog, setPluginContext
@Parameter(defaultValue="${project.build.directory}/reports", required=true) protected File outputDirectory
A plugin may use any subdirectory structure (either using a hard-coded name or, ideally, an additional
user-defined mojo parameter with a default value) to generate multi-page reports or external reports with the
main output file (entry point) denoted by MavenReport.getOutputName()
.
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${mojoExecution}", readonly=true, required=true) protected org.apache.maven.plugin.MojoExecution mojoExecution
@Parameter(defaultValue="${reactorProjects}", required=true, readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjects
@Parameter(defaultValue="${repositorySystemSession}", readonly=true, required=true) protected org.eclipse.aether.RepositorySystemSession repoSession
@Parameter(defaultValue="${project.remoteProjectRepositories}", readonly=true, required=true) protected List<org.eclipse.aether.repository.RemoteRepository> remoteProjectRepositories
@Parameter(defaultValue="${basedir}/src/site") protected File siteDirectory
site.xml
file.@Parameter(defaultValue="default") protected String locale
SiteTool.DEFAULT_LOCALE
,
SiteTool.getSiteLocales(String)
@Parameter(defaultValue="${project.build.outputTimestamp}") protected String outputTimestamp
yyyy-MM-dd'T'HH:mm:ssXXX
or as an int representing seconds since the epoch (like
SOURCE_DATE_EPOCH).@Component protected org.apache.maven.doxia.tools.SiteTool siteTool
@Component protected org.apache.maven.doxia.siterenderer.Renderer siteRenderer
@Parameter(property="output.format") protected String outputFormat
public final void execute() throws org.apache.maven.plugin.MojoExecutionException
final
as it is not expected to be overridden:
maven-reporting-impl
provides all necessary plumbing.execute
in interface org.apache.maven.plugin.Mojo
org.apache.maven.plugin.MojoExecutionException
- if an error occurs when generating the reportMojo.execute()
@Deprecated public void generate(org.apache.maven.doxia.sink.Sink sink, Locale locale) throws org.apache.maven.reporting.MavenReportException
generate(Sink, SinkFactory, Locale)
instead.generate
in interface org.apache.maven.reporting.MavenReport
sink
- the sink to use for the generation.locale
- the wanted locale to generate the report, could be null.MavenReportException
- if anypublic void generate(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, Locale locale) throws org.apache.maven.reporting.MavenReportException
generate
in interface org.apache.maven.reporting.MavenMultiPageReport
sink
- sinkFactory
- locale
- MavenReportException
public String getCategoryName()
getCategoryName
in interface org.apache.maven.reporting.MavenReport
public File getReportOutputDirectory()
getReportOutputDirectory
in interface org.apache.maven.reporting.MavenReport
public void setReportOutputDirectory(File reportOutputDirectory)
setReportOutputDirectory
in interface org.apache.maven.reporting.MavenReport
protected String getOutputDirectory()
protected org.apache.maven.project.MavenProject getProject()
protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
protected String getInputEncoding()
null
.protected String getOutputEncoding()
null
.protected Locale getLocale()
protected void closeReport()
public org.apache.maven.doxia.sink.Sink getSink()
public org.apache.maven.doxia.sink.SinkFactory getSinkFactory()
public boolean isExternalReport()
isExternalReport
in interface org.apache.maven.reporting.MavenReport
false
by default.MavenReport.isExternalReport()
public boolean canGenerateReport() throws org.apache.maven.reporting.MavenReportException
canGenerateReport
in interface org.apache.maven.reporting.MavenReport
org.apache.maven.reporting.MavenReportException
protected abstract void executeReport(Locale locale) throws org.apache.maven.reporting.MavenReportException
locale
- the wanted locale to return the report's description, could be null
.MavenReportException
- if anyprotected File getXrefLocation(File location, boolean test)
location
- the XRef location provided via plugin parameter, if anytest
- whether it is test sourceprotected String constructXrefLocation(File location, boolean test)
getReportOutputDirectory()
with getXrefLocation(File, boolean)
.location
- the XRef location provided via plugin parameter, if anytest
- whether it is test sourceCopyright © 2002–2024 The Apache Software Foundation. All rights reserved.