Class 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 Details

    • stagingSiteURL

      @Parameter(property="stagingSiteURL") private 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:
    • stagingSiteId

      @Parameter(property="stagingSiteId", alias="stagingRepositoryId") private 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 the settings.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 of distributionManagement.site.id will be taken as default, unless this is not defined either then the String "stagingSite" is used. Note that the alias stagingRepositoryId is deprecated for removal.

      Since:
      2.0.1
  • Constructor Details

    • SiteStageDeployMojo

      public SiteStageDeployMojo()
  • Method Details

    • isDeploy

      protected boolean isDeploy()
      Description copied from class: AbstractDeployMojo
      Detect if the mojo is staging or deploying.
      Specified by:
      isDeploy in class AbstractDeployMojo
      Returns:
      true if the mojo is for deploy and not staging (local or deploy)
    • determineTopDistributionManagementSiteUrl

      protected String determineTopDistributionManagementSiteUrl() throws org.apache.maven.plugin.MojoExecutionException
      If stagingSiteURL is configured, top most parent with same staging site url will be used.
      Overrides:
      determineTopDistributionManagementSiteUrl in class AbstractStagingMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • determineDeploySite

      protected org.apache.maven.model.Site determineDeploySite() throws org.apache.maven.plugin.MojoExecutionException
      Specified by:
      determineDeploySite in class AbstractDeployMojo
      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 which getStagingSiteURL(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 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 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 String determineStagingSiteId()