Class SiteStageMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.site.AbstractSiteMojo
org.apache.maven.plugins.site.deploy.AbstractDeployMojo
org.apache.maven.plugins.site.deploy.AbstractStagingMojo
org.apache.maven.plugins.site.deploy.SiteStageMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
@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
- Version:
- $Id: SiteStageMojo.java 1738477 2016-04-10 22:35:08Z hboutemy $
-
Field Summary
FieldsFields inherited from class org.apache.maven.plugins.site.deploy.AbstractStagingMojo
DEFAULT_STAGING_DIRECTORY, topSiteURLFields inherited from class org.apache.maven.plugins.site.deploy.AbstractDeployMojo
mavenSessionFields 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 TypeMethodDescriptionprotected org.apache.maven.model.Siteprivate FileFind the directory where staging will take place.voidexecute()protected FileFind the build directory of the execution root project in the reactor.private static org.apache.maven.project.MavenProjectgetExecutionRootProject(List<org.apache.maven.project.MavenProject> reactorProjects) Find the execution root in the reactor.protected booleanisDeploy()Detect if the mojo is staging or deploying.Methods inherited from class org.apache.maven.plugins.site.deploy.AbstractStagingMojo
determineTopDistributionManagementSiteUrlMethods inherited from class org.apache.maven.plugins.site.deploy.AbstractDeployMojo
appendSlash, contextualize, getDeployModuleDirectory, getDeploySite, getProxyInfo, getSite, getTopDistributionManagementSiteUrl, getTopLevelProjectMethods 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
-
stagingDirectory
Staging directory location. This needs to be an absolute path, likeC:\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.MojoExecutionExceptionDescription copied from class:AbstractDeployMojo- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Overrides:
executein classAbstractDeployMojo- Throws:
org.apache.maven.plugin.MojoExecutionException
-
isDeploy
protected boolean isDeploy()Description copied from class:AbstractDeployMojoDetect if the mojo is staging or deploying.- Specified by:
isDeployin classAbstractDeployMojo- Returns:
trueif 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:
determineDeploySitein classAbstractDeployMojo- Throws:
org.apache.maven.plugin.MojoExecutionException
-
determineStagingDirectory
Find the directory where staging will take place.- Returns:
- the directory for staging
-
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.
-
getExecutionRootProject
private static org.apache.maven.project.MavenProject getExecutionRootProject(List<org.apache.maven.project.MavenProject> reactorProjects) Find the execution root in the reactor.- Parameters:
reactorProjects- The projects in the reactor. May benullin which casenullis returned.- Returns:
- The execution root project in the reactor, or
nullif none can be found
-