Class 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.

    • Field Detail

      • outputDirectory

        @Parameter(property="siteOutputDirectory",
                   defaultValue="${project.reporting.outputDirectory}")
        protected java.io.File outputDirectory
        Directory where the project sites and report distributions will be generated (as html/css/...).
      • generateReports

        @Parameter(property="generateReports",
                   defaultValue="true")
        private boolean generateReports
        Convenience parameter that allows you to disable report generation.
      • generateSitemap

        @Parameter(property="generateSitemap",
                   defaultValue="false")
        private boolean generateSitemap
        Generate 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 validate
        Whether 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 Detail

      • SiteMojo

        public SiteMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Generate the project site

        throws MojoExecutionException if any

        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.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.IOException
        org.apache.maven.doxia.siterenderer.RendererException
        org.apache.maven.plugin.MojoFailureException
        org.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.IOException
        Render 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.RendererException
        java.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()