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.
- Version:
- $Id: AbstractSiteRenderingMojo.java 1767163 2016-10-30 14:50:13Z hboutemy $
-
Field Summary
FieldsModifier and TypeFieldDescriptionAdditional template properties for rendering the site.private org.codehaus.plexus.PlexusContainerprotected FileDirectory containing generated documentation.private booleanWhether to generate the summary page for project reports: project-info.html.private StringSpecifies the input encoding.protected org.apache.maven.execution.MavenSessionThe current Maven session.Module type exclusion mappings ex:fml -> **/*-m1.fml(excludes fml files ending in '-m1.fml' recursively)private StringSpecifies the output encoding.private org.apache.maven.reporting.exec.ReportPlugin[]Configuration section used internally by Maven 3.protected List<org.apache.maven.reporting.MavenReport> Reports (Maven 2).private booleanWhether to save Velocity processed Doxia content (*.<ext>.vm) to${generatedSiteDirectory}/processed.protected org.apache.maven.doxia.siterenderer.RendererSite renderer.private FileThe location of a Velocity template file to use.private FileDeprecated.use the standard m2 directory layoutFields inherited from class org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo
repositories, siteDirectoryFields inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
i18n, localRepository, project, reactorProjects, siteTool, skipFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncategoriseReports(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 voidvoidcontextualize(org.codehaus.plexus.context.Context context) protected org.apache.maven.doxia.siterenderer.SiteRenderingContextcreateSiteRenderingContext(Locale locale) protected StringGets the input files encoding.protected StringGets the effective reporting output files encoding.protected List<org.apache.maven.reporting.exec.MavenReportExecution> locateDocuments(org.apache.maven.doxia.siterenderer.SiteRenderingContext context, List<org.apache.maven.reporting.exec.MavenReportExecution> reports, Locale locale) Locate every document to be rendered for given locale: handwritten content, ie Doxia files, reports, "Project Information" and "Project Reports" category summaries.locateReports(List<org.apache.maven.reporting.exec.MavenReportExecution> reports, Map<String, org.apache.maven.doxia.siterenderer.DocumentRenderer> documents, 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(List<org.apache.maven.doxia.site.decoration.MenuItem> items, Locale locale, Map<String, org.apache.maven.reporting.MavenReport> reportsByOutputName) protected voidpopulateReportItems(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, Locale locale, Map<String, org.apache.maven.reporting.MavenReport> reportsByOutputName) Methods inherited from class org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo
prepareDecorationModelMethods inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
getLocales, getMavenVersion, isMaven3OrMoreMethods 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.plugin.Mojo
execute
-
Field Details
-
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
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
Additional template properties for rendering the site. See Doxia Site Renderer. -
siteRenderer
@Component protected org.apache.maven.doxia.siterenderer.Renderer siteRendererSite renderer. -
reports
@Parameter(defaultValue="${reports}", required=true, readonly=true) protected List<org.apache.maven.reporting.MavenReport> reportsReports (Maven 2). -
xdocDirectory
Deprecated.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 File generatedSiteDirectoryDirectory containing generated documentation. This is used to pick up other source docs that might have been generated at build time. -
mavenSession
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession mavenSessionThe current Maven session. -
reportPlugins
@Parameter(readonly=true) private org.apache.maven.reporting.exec.ReportPlugin[] reportPluginsConfiguration section used internally by Maven 3.
More details available here: http://maven.apache.org/plugins/maven-site-plugin/maven-3.html#Configuration_formats
Note: using this field is not mandatory with Maven 3 as Maven core injects usual
<reporting>section into this field.- Since:
- 3.0-beta-1 (and read-only since 3.3)
-
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 String inputEncodingSpecifies the input encoding.- Since:
- 2.3
-
outputEncoding
@Parameter(property="outputEncoding", defaultValue="${project.reporting.outputEncoding}") private String outputEncodingSpecifies the output encoding.- Since:
- 2.3
-
saveProcessedContent
@Parameter private boolean saveProcessedContentWhether to save Velocity processed Doxia content (*.<ext>.vm) to${generatedSiteDirectory}/processed.- Since:
- 3.5
-
-
Constructor Details
-
AbstractSiteRenderingMojo
public AbstractSiteRenderingMojo()
-
-
Method Details
-
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.
-
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 List<org.apache.maven.reporting.exec.MavenReportExecution> getReports() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createSiteRenderingContext
protected org.apache.maven.doxia.siterenderer.SiteRenderingContext createSiteRenderingContext(Locale locale) throws org.apache.maven.plugin.MojoExecutionException, IOException, org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoExecutionExceptionIOExceptionorg.apache.maven.plugin.MojoFailureException
-
locateReports
protected Map<String,org.apache.maven.reporting.MavenReport> locateReports(List<org.apache.maven.reporting.exec.MavenReportExecution> reports, Map<String, org.apache.maven.doxia.siterenderer.DocumentRenderer> documents, 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 Map<String,List<org.apache.maven.reporting.MavenReport>> categoriseReports(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 Map<String,org.apache.maven.doxia.siterenderer.DocumentRenderer> locateDocuments(org.apache.maven.doxia.siterenderer.SiteRenderingContext context, List<org.apache.maven.reporting.exec.MavenReportExecution> reports, Locale locale) throws IOException, org.apache.maven.doxia.siterenderer.RendererException Locate every document to be rendered for given locale:- handwritten content, ie Doxia files,
- reports,
- "Project Information" and "Project Reports" category summaries.
- Throws:
IOExceptionorg.apache.maven.doxia.siterenderer.RendererException- See Also:
-
populateReportItems
-
populateItemRefs
-