Class SiteStageMojo

All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="stage", requiresDependencyResolution=TEST) public class SiteStageMojo extends AbstractStagingMojo
Deploys the generated site to a local staging or mock directory based on the site URL specified in the <distributionManagement> section of the POM.

It can be used to test that links between module sites in a multi-module build work.

This goal requires the site to already have been generated using the site goal, such as by calling mvn site.

Since:
2.0
  • Field Details

    • stagingDirectory

      @Parameter(property="stagingDirectory") private File stagingDirectory
      Staging directory location. This needs to be an absolute path, like C:\stagingArea\myProject\ on Windows or /stagingArea/myProject/ on Unix. If this is not specified, the site will be staged in ${project.build.directory}/staging.
      Since:
      2.3
  • Constructor Details

    • SiteStageMojo

      public SiteStageMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Description copied from class: AbstractDeployMojo
      Specified by:
      execute in interface org.apache.maven.plugin.Mojo
      Overrides:
      execute in class AbstractDeployMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • isDeploy

      protected boolean isDeploy()
      Description copied from class: AbstractDeployMojo
      Detect if the mojo is staging or deploying.
      Specified by:
      isDeploy in class AbstractDeployMojo
      Returns:
      true if the mojo is for deploy and not staging (local or deploy)
    • determineDeploySite

      protected org.apache.maven.model.Site determineDeploySite() throws org.apache.maven.plugin.MojoExecutionException
      Specified by:
      determineDeploySite in class AbstractDeployMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • determineStagingDirectory

      private File determineStagingDirectory()
      Find the directory where staging will take place.
      Returns:
      the directory for staging
    • getExecutionRootBuildDirectory

      protected File getExecutionRootBuildDirectory()
      Find the build directory of the execution root project in the reactor. If no execution root project is found, the build directory of the current project is returned.
      Returns:
      the build directory of the execution root project.