Class AbstractSiteRenderingMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugins.site.AbstractSiteMojo
-
- org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo
-
- org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
- Direct Known Subclasses:
SiteMojo,SiteRunMojo
public abstract class AbstractSiteRenderingMojo extends AbstractSiteDescriptorMojo implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Base class for site rendering mojos.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Object>attributesAdditional template properties for rendering the site.private org.codehaus.plexus.PlexusContainercontainerprotected java.io.FilegeneratedSiteDirectoryDirectory containing generated documentation in source format (Doxia supported markup).private booleangenerateProjectInfoWhether to generate the summary page for project reports: project-info.html.private java.lang.StringinputEncodingSpecifies the input encoding.protected org.apache.maven.execution.MavenSessionmavenSessionThe current Maven session.private java.util.Map<java.lang.String,java.lang.String>moduleExcludesModule type exclusion mappings ex:fml -> **/*-m1.fml(excludes fml files ending in '-m1.fml' recursively)private java.lang.StringoutputEncodingSpecifies the output encoding.private org.apache.maven.model.Reportingreportingreplaces previous reportPlugins parameter, that was injected by Maven core from reporting section: but this new configuration format has been abandoned.protected java.util.List<org.apache.maven.reporting.MavenReport>reportsReports (Maven 2).private booleansaveProcessedContentWhether to save Velocity processed Doxia content (*.<ext>.vm) to${generatedSiteDirectory}/processed.protected org.apache.maven.doxia.siterenderer.RenderersiteRendererSite renderer.private java.io.FiletemplateFileThe location of a Velocity template file to use.private java.io.FilexdocDirectoryDeprecated.use the standard m2 directory layout-
Fields inherited from class org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo
repositories, siteDirectory
-
Fields inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
i18n, localRepository, project, reactorProjects, siteTool, skip
-
-
Constructor Summary
Constructors Constructor Description AbstractSiteRenderingMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,java.util.List<org.apache.maven.reporting.MavenReport>>categoriseReports(java.util.Collection<org.apache.maven.reporting.MavenReport> reports)Go through the collection of reports and put each report into a list for the appropriate category.protected voidcheckInputEncoding()voidcontextualize(org.codehaus.plexus.context.Context context)protected org.apache.maven.doxia.siterenderer.SiteRenderingContextcreateSiteRenderingContext(java.util.Locale locale)protected java.lang.StringgetInputEncoding()Gets the input files encoding.protected java.lang.StringgetOutputEncoding()Gets the effective reporting output files encoding.private org.apache.maven.model.ReportPlugin[]getReportingPlugins()Get the report plugins from reporting section, adding if necessary (ni.e.protected java.util.List<org.apache.maven.reporting.exec.MavenReportExecution>getReports()private java.lang.StringgetSitePluginInfo()protected java.util.Map<java.lang.String,org.apache.maven.doxia.siterenderer.DocumentRenderer>locateDocuments(org.apache.maven.doxia.siterenderer.SiteRenderingContext context, java.util.List<org.apache.maven.reporting.exec.MavenReportExecution> reports, java.util.Locale locale)Locate every document to be rendered for given locale: handwritten content, ie Doxia files, reports, "Project Information" and "Project Reports" category summaries.protected java.util.Map<java.lang.String,org.apache.maven.reporting.MavenReport>locateReports(java.util.List<org.apache.maven.reporting.exec.MavenReportExecution> reports, java.util.Map<java.lang.String,org.apache.maven.doxia.siterenderer.DocumentRenderer> documents, java.util.Locale locale)Go through the list of reports and process each one like this: Add the report to a map of reports keyed by filename having the report itself as value If the report is not yet in the map of documents, add it together with a suitable rendererprivate voidpopulateItemRefs(java.util.List<org.apache.maven.doxia.site.decoration.MenuItem> items, java.util.Locale locale, java.util.Map<java.lang.String,org.apache.maven.reporting.MavenReport> reportsByOutputName)protected voidpopulateReportItems(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, java.util.Locale locale, java.util.Map<java.lang.String,org.apache.maven.reporting.MavenReport> reportsByOutputName)-
Methods inherited from class org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo
prepareDecorationModel
-
Methods inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
getLocales, getMavenVersion, isMaven3OrMore
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
moduleExcludes
@Parameter private java.util.Map<java.lang.String,java.lang.String> moduleExcludes
Module type exclusion mappings ex:fml -> **/*-m1.fml(excludes fml files ending in '-m1.fml' recursively) The configuration looks like this:<moduleExcludes> <moduleType>filename1.ext,**/*sample.ext</moduleType> <!-- moduleType can be one of 'apt', 'fml' or 'xdoc'. --> <!-- The value is a comma separated list of --> <!-- filenames or fileset patterns. --> <!-- Here's an example: --> <xdoc>changes.xml,navigation.xml</xdoc> </moduleExcludes>
-
templateFile
@Parameter(property="templateFile") private java.io.File templateFile
The location of a Velocity template file to use. When used, skins and the default templates, CSS and images are disabled. It is highly recommended that you package this as a skin instead.- Since:
- 2.0-beta-5
-
attributes
@Parameter private java.util.Map<java.lang.String,java.lang.Object> attributes
Additional template properties for rendering the site. See Doxia Site Renderer.
-
siteRenderer
@Component protected org.apache.maven.doxia.siterenderer.Renderer siteRenderer
Site renderer.
-
reports
@Parameter(defaultValue="${reports}", required=true, readonly=true) protected java.util.List<org.apache.maven.reporting.MavenReport> reportsReports (Maven 2).
-
xdocDirectory
@Parameter(defaultValue="${basedir}/xdocs") private java.io.File xdocDirectoryDeprecated.use the standard m2 directory layoutAlternative directory for xdoc source, useful for m1 to m2 migration
-
generatedSiteDirectory
@Parameter(alias="workingDirectory", defaultValue="${project.build.directory}/generated-site") protected java.io.File generatedSiteDirectoryDirectory containing generated documentation in source format (Doxia supported markup). This is used to pick up other source docs that might have been generated at build time (by reports or any other build time mean). This directory is expected to have the same structure assiteDirectory(ie. one directory per Doxia-source-supported markup types).
-
mavenSession
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession mavenSessionThe current Maven session.
-
reporting
@Parameter(defaultValue="${project.reporting}", readonly=true) private org.apache.maven.model.Reporting reportingreplaces previous reportPlugins parameter, that was injected by Maven core from reporting section: but this new configuration format has been abandoned.- Since:
- 3.7.1
-
container
private org.codehaus.plexus.PlexusContainer container
-
generateProjectInfo
@Parameter(property="generateProjectInfo", defaultValue="true") private boolean generateProjectInfoWhether to generate the summary page for project reports: project-info.html.- Since:
- 2.3
-
inputEncoding
@Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}") private java.lang.String inputEncodingSpecifies the input encoding.- Since:
- 2.3
-
outputEncoding
@Parameter(property="outputEncoding", defaultValue="${project.reporting.outputEncoding}") private java.lang.String outputEncodingSpecifies the output encoding.- Since:
- 2.3
-
saveProcessedContent
@Parameter private boolean saveProcessedContent
Whether to save Velocity processed Doxia content (*.<ext>.vm) to${generatedSiteDirectory}/processed.- Since:
- 3.5
-
-
Method Detail
-
getInputEncoding
protected java.lang.String getInputEncoding()
Gets the input files encoding.- Returns:
- The input files encoding, never
null.
-
getOutputEncoding
protected java.lang.String getOutputEncoding()
Gets the effective reporting output files encoding.- Returns:
- The effective reporting output file encoding, never
null.
-
contextualize
public void contextualize(org.codehaus.plexus.context.Context context) throws org.codehaus.plexus.context.ContextException- Specified by:
contextualizein interfaceorg.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable- Throws:
org.codehaus.plexus.context.ContextException
-
checkInputEncoding
protected void checkInputEncoding()
-
getReports
protected java.util.List<org.apache.maven.reporting.exec.MavenReportExecution> getReports() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getReportingPlugins
private org.apache.maven.model.ReportPlugin[] getReportingPlugins()
Get the report plugins from reporting section, adding if necessary (ni.e. not excluded) default reports (i.e. maven-project-info-reports)- Returns:
- the effective list of reports
- Since:
- 3.7.1
-
createSiteRenderingContext
protected org.apache.maven.doxia.siterenderer.SiteRenderingContext createSiteRenderingContext(java.util.Locale locale) throws org.apache.maven.plugin.MojoExecutionException, java.io.IOException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionjava.io.IOExceptionorg.apache.maven.plugin.MojoFailureException
-
locateReports
protected java.util.Map<java.lang.String,org.apache.maven.reporting.MavenReport> locateReports(java.util.List<org.apache.maven.reporting.exec.MavenReportExecution> reports, java.util.Map<java.lang.String,org.apache.maven.doxia.siterenderer.DocumentRenderer> documents, java.util.Locale locale)Go through the list of reports and process each one like this:- Add the report to a map of reports keyed by filename having the report itself as value
- If the report is not yet in the map of documents, add it together with a suitable renderer
- Parameters:
reports- A List of MavenReportsdocuments- A Map of documents, keyed by filenamelocale- the Locale the reports are processed for.- Returns:
- A map with all reports keyed by filename having the report itself as value. The map will be used to populate a menu.
-
categoriseReports
protected java.util.Map<java.lang.String,java.util.List<org.apache.maven.reporting.MavenReport>> categoriseReports(java.util.Collection<org.apache.maven.reporting.MavenReport> reports)
Go through the collection of reports and put each report into a list for the appropriate category. The list is put into a map keyed by the name of the category.- Parameters:
reports- A Collection of MavenReports- Returns:
- A map keyed category having the report itself as value
-
locateDocuments
protected java.util.Map<java.lang.String,org.apache.maven.doxia.siterenderer.DocumentRenderer> locateDocuments(org.apache.maven.doxia.siterenderer.SiteRenderingContext context, java.util.List<org.apache.maven.reporting.exec.MavenReportExecution> reports, java.util.Locale locale) throws java.io.IOException, org.apache.maven.doxia.siterenderer.RendererExceptionLocate every document to be rendered for given locale:- handwritten content, ie Doxia files,
- reports,
- "Project Information" and "Project Reports" category summaries.
- Throws:
java.io.IOExceptionorg.apache.maven.doxia.siterenderer.RendererException- See Also:
CategorySummaryDocumentRenderer
-
getSitePluginInfo
private java.lang.String getSitePluginInfo()
-
populateReportItems
protected void populateReportItems(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, java.util.Locale locale, java.util.Map<java.lang.String,org.apache.maven.reporting.MavenReport> reportsByOutputName)
-
populateItemRefs
private void populateItemRefs(java.util.List<org.apache.maven.doxia.site.decoration.MenuItem> items, java.util.Locale locale, java.util.Map<java.lang.String,org.apache.maven.reporting.MavenReport> reportsByOutputName)
-
-