public abstract class AbstractAWSMojo<S extends com.amazonaws.AmazonWebServiceClient>
extends org.apache.maven.plugin.AbstractMojo
implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
TODO: Refactor into tiny, delegated classes. Currently its a huge bloat, but it works, right?
NOTE: Settings in this class use properties based in "beanstalker", which is the project. The beanstalk module, though, prefixes then as "beanstalk" instead
Parts of this class come from maven-gae-plugin's source code.
Modifier and Type | Field and Description |
---|---|
protected com.amazonaws.auth.AWSCredentialsProvider |
awsCredentialsProvider
AWS Credentials
|
protected AWSClientFactory |
clientFactory |
protected org.codehaus.plexus.context.Context |
context |
protected String |
credentialId
The credential id (on
~/.aws/credentials file) to use) |
protected Charset |
DEFAULT_CHARSET |
protected boolean |
ignoreExceptions
Ignore Exceptions?
|
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
protected String |
regionName
Service region e.g.
|
protected com.amazonaws.regions.Region |
regionObj |
protected String |
serverId
The server id in maven settings.xml to use for AWS Services Credentials (accessKey /
secretKey)
|
protected org.apache.maven.execution.MavenSession |
session |
protected org.apache.maven.settings.Settings |
settings
Maven Settings Reference
|
protected boolean |
verbose
Verbose Logging?
|
protected String |
version |
Modifier | Constructor and Description |
---|---|
protected |
AbstractAWSMojo() |
Modifier and Type | Method and Description |
---|---|
protected void |
configure()
Extension Point - Meant for others to declare and redefine variables as needed.
|
void |
contextualize(org.codehaus.plexus.context.Context context) |
protected <T extends com.amazonaws.AmazonWebServiceClient> |
createServiceFor(Class<T> serviceClass) |
protected void |
displayResults(Object result) |
void |
execute() |
protected abstract Object |
executeInternal() |
protected Expose |
exposeSettings(String serverId) |
com.amazonaws.auth.AWSCredentialsProvider |
getAWSCredentials() |
protected com.amazonaws.ClientConfiguration |
getClientConfiguration() |
AWSClientFactory |
getClientFactory() |
protected Properties |
getProperties() |
com.amazonaws.regions.Region |
getRegion() |
S |
getService() |
protected String |
getUserAgent() |
void |
handleException(Exception e) |
boolean |
isVerbose() |
protected void |
setupService() |
protected void |
setupVersion() |
protected final Charset DEFAULT_CHARSET
@Parameter(defaultValue="${session}", required=true) protected org.apache.maven.execution.MavenSession session
@Parameter(property="settings", required=true, readonly=true) protected org.apache.maven.settings.Settings settings
protected com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider
@Parameter(property="beanstalker.serverId", defaultValue="aws.amazon.com") protected String serverId
@Parameter(property="beanstalker.credentialId", defaultValue="default") protected String credentialId
~/.aws/credentials
file) to use)@Parameter(property="beanstalker.verbose", defaultValue="false") protected boolean verbose
@Parameter(property="beanstalker.ignoreExceptions", defaultValue="false") protected boolean ignoreExceptions
protected String version
protected org.codehaus.plexus.context.Context context
@Parameter(property="beanstalker.region") protected String regionName
Service region e.g. "us-east-1"
See this list for reference.
protected com.amazonaws.regions.Region regionObj
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
protected AWSClientFactory clientFactory
public com.amazonaws.regions.Region getRegion()
public com.amazonaws.auth.AWSCredentialsProvider getAWSCredentials() throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException
public AWSClientFactory getClientFactory()
protected Expose exposeSettings(String serverId) throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException
public void contextualize(org.codehaus.plexus.context.Context context) throws org.codehaus.plexus.context.ContextException
contextualize
in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
org.codehaus.plexus.context.ContextException
protected com.amazonaws.ClientConfiguration getClientConfiguration()
protected final String getUserAgent()
protected void setupVersion()
protected void setupService() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected <T extends com.amazonaws.AmazonWebServiceClient> T createServiceFor(Class<T> serviceClass) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected Properties getProperties()
public S getService()
public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
execute
in interface org.apache.maven.plugin.Mojo
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected void configure()
public void handleException(Exception e) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected void displayResults(Object result)
public boolean isVerbose()
Copyright © 2011–2019 ingenieux. All rights reserved.