Class SiteStageDeployMojo
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.SiteStageDeployMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="stage-deploy",
requiresDependencyResolution=TEST)
public class SiteStageDeployMojo
extends AbstractStagingMojo
Deploys the generated site to a staging or mock URL to the site URL
specified in the
<distributionManagement> section of the
POM, using wagon supported protocols- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe identifier of the site where the staged site will be deployed.private StringThe staged site will be deployed to this URL.Fields inherited from class org.apache.maven.plugins.site.deploy.AbstractStagingMojo
DEFAULT_STAGING_DIRECTORY, topSiteURLFields inherited from class org.apache.maven.plugins.site.deploy.AbstractDeployMojo
mavenSession, settingsDecrypterFields inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
i18n, project, siteTool, skipFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.maven.model.Siteprivate StringFind the URL where staging will take place.private Stringprotected StringIfstagingSiteURLis configured, top most parent with same staging site url will be used.private StringgetStagingSiteURL(org.apache.maven.project.MavenProject project) Extract the value of the stagingSiteURL configuration parameter of maven-site-plugin for the given project.private org.apache.maven.project.MavenProjectExtract the distributionManagement.site of the top most project in the hierarchy that specifies a stagingSiteURL, starting at the actual MavenProject.protected booleanisDeploy()Detect if the mojo is staging or deploying.Methods inherited from class org.apache.maven.plugins.site.deploy.AbstractDeployMojo
appendSlash, execute, getAuthenticationInfo, getDeployModuleDirectory, getDeploySite, getSite, getTopDistributionManagementSiteUrl, getTopLevelProjectMethods inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
getLocalesMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
stagingSiteURL
The staged site will be deployed to this URL. If you don't specify this, the default-value will be "${project.distributionManagement.site.url}/staging", where "project" is either the current project or, in a reactor build, the top level project in the reactor.Note that even if you specify this plugin parameter, you still need to indicate ${project.distributionManagement.site.url} at least in your top level project in order for relative links between modules to be resolved correctly.
- Since:
- 2.3
- See Also:
-
stagingSiteId
The identifier of the site where the staged site will be deployed. This id will be used to lookup a corresponding<server>entry from thesettings.xml. If a matching<server>entry is found, its configured credentials will be used for authentication. If this is not specified, then the corresponding value ofdistributionManagement.site.idwill be taken as default, unless this is not defined either then the String"stagingSite"is used. Note that the aliasstagingRepositoryIdis deprecated for removal.- Since:
- 2.0.1
-
-
Constructor Details
-
SiteStageDeployMojo
public SiteStageDeployMojo()
-
-
Method Details
-
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)
-
determineTopDistributionManagementSiteUrl
protected String determineTopDistributionManagementSiteUrl() throws org.apache.maven.plugin.MojoExecutionExceptionIfstagingSiteURLis configured, top most parent with same staging site url will be used.- Overrides:
determineTopDistributionManagementSiteUrlin classAbstractStagingMojo- Throws:
org.apache.maven.plugin.MojoExecutionException
-
determineDeploySite
protected org.apache.maven.model.Site determineDeploySite() throws org.apache.maven.plugin.MojoExecutionException- Specified by:
determineDeploySitein classAbstractDeployMojo- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getTopMostParentWithSameStagingSiteURL
private org.apache.maven.project.MavenProject getTopMostParentWithSameStagingSiteURL()Extract the distributionManagement.site of the top most project in the hierarchy that specifies a stagingSiteURL, starting at the actual MavenProject. This climbs up the project hierarchy and returns the site of the top most project for whichgetStagingSiteURL(org.apache.maven.project.MavenProject)returns same URL as actual.- Returns:
- the site for the top most project that has a stagingSiteURL. Not null.
-
getStagingSiteURL
Extract the value of the stagingSiteURL configuration parameter of maven-site-plugin for the given project.- Parameters:
project- The MavenProject, not null- Returns:
- The stagingSiteURL for the project, or null if it doesn't have one
-
determineStageDeploySiteURL
Find the URL where staging will take place.- Returns:
- the site URL for staging
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
determineStagingSiteId
-