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
Fields Modifier and Type Field Description private java.io.File
stagingDirectory
Staging directory location.-
Fields 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
-
-
Constructor Summary
Constructors Constructor Description SiteStageMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.maven.model.Site
determineDeploySite()
private java.io.File
determineStagingDirectory()
Find the directory where staging will take place.void
execute()
protected java.io.File
getExecutionRootBuildDirectory()
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
-
-
-
-
Field Detail
-
stagingDirectory
@Parameter(property="stagingDirectory") private java.io.File 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
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException
Description 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
private java.io.File determineStagingDirectory()
Find the directory where staging will take place.- Returns:
- the directory for staging
-
getExecutionRootBuildDirectory
protected java.io.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.
-
-