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
- Direct Known Subclasses:
AutoRefreshMojo,SiteMojo,SiteRunMojo
Base class for site rendering mojos.
- Author:
- Brett Porter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected File[]Optional list of source directories to be used instead ofAbstractSiteDescriptorMojo.siteDirectoryfor rendering edit URLs.protected FileDirectory containing generated documentation in source format (Doxia supported markup).protected final org.apache.maven.reporting.exec.MavenReportExecutorprotected org.apache.maven.execution.MavenSessionThe current Maven session.protected org.apache.maven.plugin.MojoExecutionThe mojo executionprotected StringTimestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).protected final org.apache.maven.doxia.siterenderer.SiteRendererSite renderer.Fields inherited from class org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo
reactorProjects, remoteProjectRepositories, repoSession, siteDirectoryFields inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
i18n, project, siteTool, skipFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSiteRenderingMojo(org.apache.maven.doxia.site.inheritance.SiteModelInheritanceAssembler assembler, org.apache.maven.doxia.siterenderer.SiteRenderer siteRenderer, org.apache.maven.reporting.exec.MavenReportExecutor mavenReportExecutor) -
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 voidprotected 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> getReports(File outputDirectory) 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 rendererprotected voidpopulateReportItems(org.apache.maven.doxia.site.SiteModel siteModel, Locale locale, Map<String, org.apache.maven.reporting.MavenReport> reportsByOutputName) Methods inherited from class org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo
prepareSiteModelMethods inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
getLocalesMethods 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
-
generatedSiteDirectory
@Parameter(alias="workingDirectory", defaultValue="${project.build.directory}/generated-site") protected 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). This is never editable. -
alternativeSiteSourceDirectories
Optional list of source directories to be used instead ofAbstractSiteDescriptorMojo.siteDirectoryfor rendering edit URLs. This is only used for documents rendered fromAbstractSiteDescriptorMojo.siteDirectorybut not for those rendered fromgeneratedSiteDirectory. as the latter ones are always considered non-editable. The first directory containing a document with the given relative path is used for generating the URL (the same relative path as the document has toAbstractSiteDescriptorMojo.siteDirectory).- Since:
- 3.22.0
-
mavenSession
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession mavenSessionThe current Maven session. -
mojoExecution
@Parameter(defaultValue="${mojoExecution}", readonly=true, required=true) protected org.apache.maven.plugin.MojoExecution mojoExecutionThe mojo execution -
outputTimestamp
Timestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).- Since:
- 3.9.0
-
siteRenderer
protected final org.apache.maven.doxia.siterenderer.SiteRenderer siteRendererSite renderer. -
mavenReportExecutor
protected final org.apache.maven.reporting.exec.MavenReportExecutor mavenReportExecutor
-
-
Constructor Details
-
AbstractSiteRenderingMojo
protected AbstractSiteRenderingMojo(org.apache.maven.doxia.site.inheritance.SiteModelInheritanceAssembler assembler, org.apache.maven.doxia.siterenderer.SiteRenderer siteRenderer, org.apache.maven.reporting.exec.MavenReportExecutor mavenReportExecutor)
-
-
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.
-
checkInputEncoding
protected void checkInputEncoding() -
getReports
protected List<org.apache.maven.reporting.exec.MavenReportExecution> getReports(File outputDirectory) 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.
- Parameters:
context- the site contextreports- the documentslocale- the locale- Returns:
- the documents and their renderers
- Throws:
IOException- in case of file reading issueorg.apache.maven.doxia.siterenderer.RendererException- in case of Doxia rendering issue- See Also:
-
populateReportItems
-