public abstract class AbstractDeployMojo extends AbstractSiteMojo
SiteStageMojo
and SiteStageDeployMojo
.Modifier and Type | Field and Description |
---|---|
protected org.apache.maven.execution.MavenSession |
mavenSession |
i18n, project, siteTool, skip
Constructor and Description |
---|
AbstractDeployMojo() |
Modifier and Type | Method and Description |
---|---|
protected static String |
appendSlash(String url)
Make sure the given URL ends with a slash.
|
protected abstract org.apache.maven.model.Site |
determineDeploySite() |
protected abstract String |
determineTopDistributionManagementSiteUrl() |
void |
execute() |
org.apache.maven.wagon.authentication.AuthenticationInfo |
getAuthenticationInfo(String id) |
protected String |
getDeployModuleDirectory()
Find the relative path between the distribution URLs of the top site and the current project.
|
protected org.apache.maven.model.Site |
getDeploySite()
Get the site used for deployment, with its id to look up credential settings and the target URL for the deploy.
|
protected static org.apache.maven.model.Site |
getSite(org.apache.maven.project.MavenProject project)
Extract the distributionManagement site from the given MavenProject.
|
protected String |
getTopDistributionManagementSiteUrl()
Get the top distribution management site url, used for module relative path calculations.
|
protected org.apache.maven.project.MavenProject |
getTopLevelProject(org.apache.maven.project.MavenProject project)
Extract the distributionManagement site of the top level parent of the given MavenProject.
|
protected abstract boolean |
isDeploy()
Detect if the mojo is staging or deploying.
|
getLocales
@Parameter(defaultValue="${session}", readonly=true) protected org.apache.maven.execution.MavenSession mavenSession
public void execute() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected static String appendSlash(String url)
url
- a Stringprotected abstract boolean isDeploy()
true
if the mojo is for deploy and not staging (local or deploy)protected String getTopDistributionManagementSiteUrl() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- in case of issuedetermineTopDistributionManagementSiteUrl()
protected abstract String determineTopDistributionManagementSiteUrl() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected org.apache.maven.model.Site getDeploySite() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- in case of issuedetermineDeploySite()
protected abstract org.apache.maven.model.Site determineDeploySite() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected String getDeployModuleDirectory() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- in case of issuepublic org.apache.maven.wagon.authentication.AuthenticationInfo getAuthenticationInfo(String id)
protected static org.apache.maven.model.Site getSite(org.apache.maven.project.MavenProject project) throws org.apache.maven.plugin.MojoExecutionException
project
- the MavenProject. Not null.org.apache.maven.plugin.MojoExecutionException
- if any of the site info is missing.protected org.apache.maven.project.MavenProject getTopLevelProject(org.apache.maven.project.MavenProject project) throws org.apache.maven.plugin.MojoExecutionException
getSite(org.apache.maven.project.MavenProject)
returns a site that resides in the
same site. Notice that it doesn't take into account if the parent is in the reactor or not.project
- the MavenProject. Not null
.null
.
Also site.getUrl() and site.getId() are guaranteed to be not null
.org.apache.maven.plugin.MojoExecutionException
- if no site info is found in the tree.URIPathDescriptor.sameSite(java.net.URI)
Copyright © 2002–2024 The Apache Software Foundation. All rights reserved.