public abstract class AbstractAzureMojo extends org.apache.maven.plugin.AbstractMojo implements TelemetryConfiguration, AuthConfiguration
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractAzureMojo.DefaultUncaughtExceptionHandler |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowTelemetry
Boolean flag to turn on/off telemetry within current Maven plugin.
|
static String |
AUTH_TYPE |
protected AuthenticationSetting |
authentication
Authentication setting for Azure Management API.
Below are the supported sub-elements within <authentication>. |
private com.microsoft.azure.management.Azure |
azure |
static String |
AZURE_INIT_FAIL |
private AzureAuthHelper |
azureAuthHelper |
protected File |
buildDirectory |
private static String |
CONFIGURATION_PATH |
protected boolean |
failsOnError
Boolean flag to control whether throwing exception from current Maven plugin when meeting any error.
If set to true, the exception from current Maven plugin will fail the current Maven run. |
static String |
FAILURE_REASON |
private static String |
FIRST_RUN_KEY |
static String |
INIT_FAILURE |
static String |
INSTALLATION_ID_KEY |
private String |
installationId |
protected org.apache.maven.shared.filtering.MavenResourcesFiltering |
mavenResourcesFiltering |
protected org.apache.maven.plugin.descriptor.PluginDescriptor |
plugin |
static String |
PLUGIN_NAME_KEY |
static String |
PLUGIN_VERSION_KEY |
private static String |
PRIVACY_STATEMENT |
protected org.apache.maven.project.MavenProject |
project |
protected org.apache.maven.execution.MavenSession |
session |
static String |
SESSION_ID_KEY |
private String |
sessionId |
protected org.apache.maven.settings.Settings |
settings
The system settings for Maven.
|
static String |
SUBSCRIPTION_ID_KEY |
protected String |
subscriptionId
Azure subscription Id.
|
static String |
TELEMETRY_NOT_ALLOWED |
private TelemetryProxy |
telemetryProxy |
| Constructor and Description |
|---|
AbstractAzureMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
debug(String message) |
protected abstract void |
doExecute()
Entry point of sub-class.
|
void |
error(String message) |
void |
execute() |
AuthenticationSetting |
getAuthenticationSetting() |
String |
getAuthType() |
com.microsoft.azure.management.Azure |
getAzureClient() |
String |
getBuildDirectoryAbsolutePath() |
String |
getInstallationId() |
org.apache.maven.shared.filtering.MavenResourcesFiltering |
getMavenResourcesFiltering() |
String |
getPluginName() |
String |
getPluginVersion() |
org.apache.maven.project.MavenProject |
getProject() |
org.apache.maven.execution.MavenSession |
getSession() |
String |
getSessionId() |
org.apache.maven.settings.Settings |
getSettings() |
String |
getSubscriptionId() |
Map<String,String> |
getTelemetryProperties() |
TelemetryProxy |
getTelemetryProxy() |
String |
getUserAgent() |
protected void |
handleException(Exception exception) |
void |
info(String message) |
void |
infoWithMultipleLines(String messages) |
protected void |
initTelemetry() |
boolean |
isFailingOnError() |
private boolean |
isFirstRun(Properties prop) |
protected boolean |
isSkipMojo()
Sub-class can override this method to decide whether skip execution.
|
boolean |
isTelemetryAllowed() |
protected void |
trackMojoFailure(String message) |
protected void |
trackMojoSkip() |
protected void |
trackMojoStart() |
protected void |
trackMojoSuccess() |
private void |
updateConfigurationFile(Properties prop) |
void |
warning(String message) |
getLog, getPluginContext, setLog, setPluginContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLogpublic static final String PLUGIN_NAME_KEY
public static final String PLUGIN_VERSION_KEY
public static final String INSTALLATION_ID_KEY
public static final String SESSION_ID_KEY
public static final String SUBSCRIPTION_ID_KEY
public static final String AUTH_TYPE
public static final String TELEMETRY_NOT_ALLOWED
public static final String INIT_FAILURE
public static final String AZURE_INIT_FAIL
public static final String FAILURE_REASON
private static final String CONFIGURATION_PATH
private static final String FIRST_RUN_KEY
private static final String PRIVACY_STATEMENT
@Parameter(defaultValue="${project}",
readonly=true,
required=true)
protected org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${session}",
readonly=true,
required=true)
protected org.apache.maven.execution.MavenSession session
@Parameter(defaultValue="${project.build.directory}",
readonly=true,
required=true)
protected File buildDirectory
@Parameter(defaultValue="${plugin}",
readonly=true,
required=true)
protected org.apache.maven.plugin.descriptor.PluginDescriptor plugin
@Parameter(defaultValue="${settings}",
readonly=true,
required=true)
protected org.apache.maven.settings.Settings settings
@Component(role=org.apache.maven.shared.filtering.MavenResourcesFiltering.class,
hint="default")
protected org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering
@Parameter protected AuthenticationSetting authentication
<authentication>. You can use one of them to authenticate
with azure<serverId> specifies the credentials of your Azure service principal, by referencing a server definition
in Maven's settings.xml<file> specifies the absolute path of your authentication file for Azure.@Parameter protected String subscriptionId
@Parameter(property="allowTelemetry",
defaultValue="true")
protected boolean allowTelemetry
@Parameter(property="failsOnError",
defaultValue="true")
protected boolean failsOnError
private AzureAuthHelper azureAuthHelper
private com.microsoft.azure.management.Azure azure
private TelemetryProxy telemetryProxy
private String sessionId
private String installationId
public org.apache.maven.project.MavenProject getProject()
public org.apache.maven.execution.MavenSession getSession()
public String getBuildDirectoryAbsolutePath()
public org.apache.maven.shared.filtering.MavenResourcesFiltering getMavenResourcesFiltering()
public org.apache.maven.settings.Settings getSettings()
getSettings in interface AuthConfigurationpublic AuthenticationSetting getAuthenticationSetting()
getAuthenticationSetting in interface AuthConfigurationpublic String getSubscriptionId()
getSubscriptionId in interface AuthConfigurationpublic boolean isTelemetryAllowed()
public boolean isFailingOnError()
public String getSessionId()
public String getInstallationId()
public String getPluginName()
public String getPluginVersion()
public String getUserAgent()
getUserAgent in interface AuthConfigurationpublic com.microsoft.azure.management.Azure getAzureClient()
throws AzureAuthFailureException
AzureAuthFailureExceptionpublic TelemetryProxy getTelemetryProxy()
protected void initTelemetry()
public Map<String,String> getTelemetryProperties()
getTelemetryProperties in interface TelemetryConfigurationpublic String getAuthType()
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
execute in interface org.apache.maven.plugin.Mojoorg.apache.maven.plugin.MojoExecutionExceptionprotected boolean isSkipMojo()
protected abstract void doExecute()
throws Exception
Exceptionprotected void trackMojoSkip()
protected void trackMojoStart()
protected void trackMojoSuccess()
protected void trackMojoFailure(String message)
protected void handleException(Exception exception) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate boolean isFirstRun(Properties prop)
private void updateConfigurationFile(Properties prop)
public void debug(String message)
public void info(String message)
public void infoWithMultipleLines(String messages)
public void warning(String message)
public void error(String message)
Copyright © 2018. All rights reserved.