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
Fields Modifier and Type Field Description private java.lang.String
stagingSiteId
The identifier of the site where the staged site will be deployed.private java.lang.String
stagingSiteURL
The staged site will be deployed to this URL.-
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 SiteStageDeployMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.maven.model.Site
determineDeploySite()
private java.lang.String
determineStageDeploySiteURL()
Find the URL where staging will take place.private java.lang.String
determineStagingSiteId()
protected java.lang.String
determineTopDistributionManagementSiteUrl()
IfstagingSiteURL
is configured, top most parent with same staging site url will be used.private java.lang.String
getStagingSiteURL(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.MavenProject
getTopMostParentWithSameStagingSiteURL()
Extract the distributionManagement.site of the top most project in the hierarchy that specifies a stagingSiteURL, starting at the actual MavenProject.protected boolean
isDeploy()
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, getTopLevelProject
-
Methods inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
getLocales
-
-
-
-
Field Detail
-
stagingSiteURL
@Parameter(property="stagingSiteURL") private java.lang.String 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:
- MavenModel#class_site
-
stagingSiteId
@Parameter(property="stagingSiteId", alias="stagingRepositoryId") private java.lang.String 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.id
will be taken as default, unless this is not defined either then the String"stagingSite"
is used. Note that the aliasstagingRepositoryId
is deprecated for removal.- Since:
- 2.0.1
-
-
Method Detail
-
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)
-
determineTopDistributionManagementSiteUrl
protected java.lang.String determineTopDistributionManagementSiteUrl() throws org.apache.maven.plugin.MojoExecutionException
IfstagingSiteURL
is configured, top most parent with same staging site url will be used.- Overrides:
determineTopDistributionManagementSiteUrl
in classAbstractStagingMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
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
-
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
private java.lang.String getStagingSiteURL(org.apache.maven.project.MavenProject project)
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
private java.lang.String determineStageDeploySiteURL() throws org.apache.maven.plugin.MojoExecutionException
Find the URL where staging will take place.- Returns:
- the site URL for staging
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
determineStagingSiteId
private java.lang.String determineStagingSiteId()
-
-