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 AbstractSiteRenderingMojoGenerates 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.
-
-
Field Summary
Fields Modifier and Type Field Description private booleangenerateReportsConvenience parameter that allows you to disable report generation.private booleangenerateSitemapGenerate a sitemap.protected java.io.FileoutputDirectoryDirectory where the project sites and report distributions will be generated (as html/css/...).private booleanvalidateWhether to validate xml input documents.-
Fields inherited from class org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo
generatedSiteDirectory, mavenSession, reports, siteRenderer
-
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 SiteMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()Generate the project siteprivate java.io.FilegetOutputDirectory(java.util.Locale locale)org.apache.maven.project.MavenProjectgetProject()org.apache.maven.execution.MavenSessiongetSession()private java.util.List<org.apache.maven.doxia.siterenderer.DocumentRenderer>renderDoxiaDocuments(java.util.Map<java.lang.String,org.apache.maven.doxia.siterenderer.DocumentRenderer> documents, org.apache.maven.doxia.siterenderer.SiteRenderingContext context, java.io.File outputDir, boolean generated)Render Doxia documents from the list given, but not reports.private voidrenderLocale(java.util.Locale locale, java.util.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, populateReportItems
-
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
-
-
-
-
Field Detail
-
outputDirectory
@Parameter(property="siteOutputDirectory", defaultValue="${project.reporting.outputDirectory}") protected java.io.File outputDirectoryDirectory where the project sites and report distributions will be generated (as html/css/...).
-
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
-
-
Method Detail
-
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:
Mojo.execute()
-
renderLocale
private void renderLocale(java.util.Locale locale, java.util.List<org.apache.maven.reporting.exec.MavenReportExecution> reports) throws java.io.IOException, org.apache.maven.doxia.siterenderer.RendererException, org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException- Throws:
java.io.IOExceptionorg.apache.maven.doxia.siterenderer.RendererExceptionorg.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionException
-
renderDoxiaDocuments
private java.util.List<org.apache.maven.doxia.siterenderer.DocumentRenderer> renderDoxiaDocuments(java.util.Map<java.lang.String,org.apache.maven.doxia.siterenderer.DocumentRenderer> documents, org.apache.maven.doxia.siterenderer.SiteRenderingContext context, java.io.File outputDir, boolean generated) throws org.apache.maven.doxia.siterenderer.RendererException, java.io.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.RendererExceptionjava.io.IOException
-
getOutputDirectory
private java.io.File getOutputDirectory(java.util.Locale locale)
-
getProject
public org.apache.maven.project.MavenProject getProject()
-
getSession
public org.apache.maven.execution.MavenSession getSession()
-
-