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
@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 Summary
FieldsFields inherited from class org.apache.maven.plugins.site.deploy.AbstractStagingMojo
DEFAULT_STAGING_DIRECTORY, topSiteURL
Fields inherited from class org.apache.maven.plugins.site.deploy.AbstractDeployMojo
mavenSession, settingsDecrypter
Fields inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
i18n, project, siteTool, skip
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.maven.model.Site
private File
Find the directory where staging will take place.void
execute()
protected File
Find the build directory of the execution root project in the reactor.protected boolean
isDeploy()
Detect if the mojo is staging or deploying.Methods inherited from class org.apache.maven.plugins.site.deploy.AbstractStagingMojo
determineTopDistributionManagementSiteUrl
Methods inherited from class org.apache.maven.plugins.site.deploy.AbstractDeployMojo
appendSlash, getAuthenticationInfo, getDeployModuleDirectory, getDeploySite, getSite, getTopDistributionManagementSiteUrl, getTopLevelProject
Methods inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
getLocales
Methods 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:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Overrides:
execute
in classAbstractDeployMojo
- 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 classAbstractDeployMojo
- 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 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.
-