public abstract class AbstractDeployMojo extends AbstractSiteMojo implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
SiteStageMojo and SiteStageDeployMojo.| Modifier and Type | Field and Description |
|---|---|
protected MavenSession |
mavenSession |
i18n, localRepository, project, reactorProjects, runtimeInformation, 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.
|
void |
contextualize(org.codehaus.plexus.context.Context context) |
protected abstract Site |
determineDeploySite() |
protected abstract String |
determineTopDistributionManagementSiteUrl() |
void |
execute() |
protected String |
getDeployModuleDirectory()
Find the relative path between the distribution URLs of the top site and the current project.
|
protected Site |
getDeploySite()
Get the site used for deployment, with its id to look up credential settings and the target URL for the deploy.
|
static ProxyInfo |
getProxyInfo(Repository repository,
WagonManager wagonManager)
Get proxy information.
|
protected static Site |
getSite(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 MavenProject |
getTopLevelProject(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, getMavenVersiongetLog, getPluginContext, setLog, setPluginContext@Parameter(defaultValue="${session}", readonly=true) protected MavenSession mavenSession
public void execute()
throws MojoExecutionException
execute in interface MojoMojoExecutionExceptionprotected 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 MojoExecutionException
MojoExecutionException - in case of issuedetermineTopDistributionManagementSiteUrl()protected abstract String determineTopDistributionManagementSiteUrl() throws MojoExecutionException
MojoExecutionExceptionprotected Site getDeploySite() throws MojoExecutionException
MojoExecutionException - in case of issuedetermineDeploySite()protected abstract Site determineDeploySite() throws MojoExecutionException
MojoExecutionExceptionprotected String getDeployModuleDirectory() throws MojoExecutionException
MojoExecutionException - in case of issuepublic static ProxyInfo getProxyInfo(Repository repository, WagonManager wagonManager)
Get the ProxyInfo of the proxy associated with the host
and the protocol of the given repository.
Extract from J2SE Doc : Networking Properties - nonProxyHosts : "The value can be a list of hosts, each separated by a |, and in addition a wildcard character (*) can be used for matching"
Defensively support comma (",") and semi colon (";") in addition to pipe ("|") as separator.
repository - the Repository to extract the ProxyInfo fromwagonManager - the WagonManager used to connect to the Repositorynull if no matching proxy is foundpublic void contextualize(org.codehaus.plexus.context.Context context)
throws org.codehaus.plexus.context.ContextException
contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizableorg.codehaus.plexus.context.ContextExceptionprotected static Site getSite(MavenProject project) throws MojoExecutionException
project - the MavenProject. Not null.MojoExecutionException - if any of the site info is missing.protected MavenProject getTopLevelProject(MavenProject project) throws 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.MojoExecutionException - if no site info is found in the tree.URIPathDescriptor.sameSite(java.net.URI)Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.