Class SiteMojo
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
org.apache.maven.plugins.site.render.SiteMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
- Direct Known Subclasses:
SiteJarMojo
@Mojo(name="site",
requiresDependencyResolution=TEST,
requiresReports=true)
public class SiteMojo
extends AbstractSiteRenderingMojo
Generates the site for a single project.
Note that links between module sites in a multi module build will not work, since local build directory structure doesn't match deployed site.
- Version:
- $Id: SiteMojo.java 1754182 2016-07-26 21:35:00Z hboutemy $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanConvenience parameter that allows you to disable report generation.private booleanGenerate a sitemap.protected FileDirectory where the project sites and report distributions will be generated.private booleanWhether to validate xml input documents.Fields inherited from class org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo
generatedSiteDirectory, mavenSession, reports, siteRendererFields 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 TypeMethodDescriptionvoidexecute()Generate the project siteprivate FilegetOutputDirectory(Locale locale) org.apache.maven.project.MavenProjectorg.apache.maven.execution.MavenSessionprivate List<org.apache.maven.doxia.siterenderer.DocumentRenderer> renderDoxiaDocuments(Map<String, org.apache.maven.doxia.siterenderer.DocumentRenderer> documents, org.apache.maven.doxia.siterenderer.SiteRenderingContext context, File outputDir, boolean generated) Render Doxia documents from the list given, but not reports.private voidrenderLocale(Locale locale, List<org.apache.maven.reporting.exec.MavenReportExecution> reports) Methods inherited from class org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo
categoriseReports, checkInputEncoding, contextualize, createSiteRenderingContext, getInputEncoding, getOutputEncoding, getReports, locateDocuments, locateReports, populateReportItemsMethods 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, setPluginContext
-
Field Details
-
outputDirectory
@Parameter(property="siteOutputDirectory", defaultValue="${project.reporting.outputDirectory}") protected File outputDirectoryDirectory where the project sites and report distributions will be generated. -
generateReports
@Parameter(property="generateReports", defaultValue="true") private boolean generateReportsConvenience parameter that allows you to disable report generation. -
generateSitemap
@Parameter(property="generateSitemap", defaultValue="false") private boolean generateSitemapGenerate a sitemap. The result will be a "sitemap.html" file at the site root.- Since:
- 2.1
-
validate
@Parameter(property="validate", defaultValue="false") private boolean validateWhether to validate xml input documents. If set to true, all input documents in xml format (in particular xdoc and fml) will be validated and any error will lead to a build failure.- Since:
- 2.1.1
-
-
Constructor Details
-
SiteMojo
public SiteMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionGenerate the project site throws MojoExecutionException if any- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException- See Also:
-
renderLocale
private void renderLocale(Locale locale, List<org.apache.maven.reporting.exec.MavenReportExecution> reports) throws IOException, org.apache.maven.doxia.siterenderer.RendererException, org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException - Throws:
IOExceptionorg.apache.maven.doxia.siterenderer.RendererExceptionorg.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionException
-
renderDoxiaDocuments
private List<org.apache.maven.doxia.siterenderer.DocumentRenderer> renderDoxiaDocuments(Map<String, org.apache.maven.doxia.siterenderer.DocumentRenderer> documents, org.apache.maven.doxia.siterenderer.SiteRenderingContext context, File outputDir, boolean generated) throws org.apache.maven.doxia.siterenderer.RendererException, IOExceptionRender Doxia documents from the list given, but not reports.- Parameters:
documents- a collection of documents containing both Doxia source files and reports- Returns:
- the sublist of documents that are not Doxia source files
- Throws:
org.apache.maven.doxia.siterenderer.RendererExceptionIOException
-
getOutputDirectory
-
getProject
public org.apache.maven.project.MavenProject getProject() -
getSession
public org.apache.maven.execution.MavenSession getSession()
-