@Mojo(name="add") public class AddMojo extends AbstractFunctionMojo
AbstractAzureMojo.DefaultUncaughtExceptionHandler, AbstractAzureMojo.RunnableWithException| Modifier and Type | Field and Description |
|---|---|
protected File |
basedir |
protected List<String> |
compileSourceRoots |
private static String |
DEFAULT_INPUT_ERROR_MESSAGE |
private static String |
FILE_EXIST |
private static String |
FIND_TEMPLATE |
private static String |
FIND_TEMPLATE_DONE |
private static String |
FIND_TEMPLATE_FAIL |
private static String |
FOUND_VALID_VALUE |
private static String |
FUNCTION_NAME_REGEXP |
protected String |
functionName
Name of the new function.
|
protected String |
functionPackageName
Package name of the new function.
|
protected String |
functionTemplate
Template for the new function
|
private static String |
LOAD_TEMPLATES |
private static String |
LOAD_TEMPLATES_DONE |
private static String |
PREPARE_PARAMS |
private static String |
PROMPT_STRING_WITH_DEFAULTVALUE |
private static String |
PROMPT_STRING_WITHOUT_DEFAULTVALUE |
private static String |
SAVE_FILE |
private static String |
SAVE_FILE_DONE |
appInsightsInstance, appInsightsKey, disableAppInsights, finalName, outputDirectory, pricingTier, region, runtime, skip, TRIGGER_TYPEappName, appServicePlanName, appServicePlanResourceGroup, appSettings, deploymentSlotSetting, deploymentType, MAVEN_PLUGIN_POSTFIX, PORTAL_URL_PATTERN, resourceGroupallowTelemetry, auth, authentication, authType, buildDirectory, DEPLOY, failsOnError, httpProxyHost, httpProxyPort, INSTALLATION_ID_KEY, mavenResourcesFiltering, plugin, PLUGIN_NAME_KEY, PLUGIN_VERSION_KEY, project, session, SESSION_ID_KEY, settings, settingsDecrypter, SUBSCRIPTION_ID_KEY, SUBSCRIPTION_NOT_FOUND, SUBSCRIPTION_NOT_SPECIFIED, SUBSCRIPTION_TEMPLATE, subscriptionId, USING_AZURE_ENVIRONMENT| Constructor and Description |
|---|
AddMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assureInputFromUser(String prompt,
String initValue,
java.util.function.Function<String,Boolean> validator,
String errorMessage,
java.util.function.Consumer<String> setter) |
protected void |
assureInputFromUser(String prompt,
String initValue,
List<String> options,
java.util.function.Consumer<String> setter) |
protected void |
assureInputInBatchMode(String input,
java.util.function.Function<String,Boolean> validator,
java.util.function.Consumer<String> setter,
boolean required) |
protected void |
createPackageDirIfNotExist(File packageDir) |
protected void |
displayParameters(Map<String,String> params) |
protected void |
doExecute() |
private String |
findElementInOptions(List<String> options,
String item) |
protected com.microsoft.azure.common.function.template.FunctionTemplate |
findTemplateByName(List<com.microsoft.azure.common.function.template.FunctionTemplate> templates,
String templateName) |
protected String |
getBasedir() |
String |
getClassName() |
String |
getFunctionName() |
String |
getFunctionPackageName() |
String |
getFunctionTemplate() |
protected com.microsoft.azure.common.function.template.FunctionTemplate |
getFunctionTemplate(List<com.microsoft.azure.common.function.template.FunctionTemplate> templates) |
private List<String> |
getOptionsForUserPrompt(String promptName) |
protected File |
getPackageDir() |
protected Scanner |
getScanner() |
protected String |
getSourceRoot() |
protected String |
getStringInputErrorMessage(com.microsoft.azure.common.function.template.FunctionSettingTemplate template) |
protected String |
getStringInputFromUser(String attributeName,
String initValue,
com.microsoft.azure.common.function.template.FunctionSettingTemplate template) |
protected String |
getStringInputPromptString(String attributeName,
String defaultValue) |
protected java.util.function.Function<String,Boolean> |
getStringInputValidator(com.microsoft.azure.common.function.template.FunctionSettingTemplate template) |
protected File |
getTargetFile(File packageDir) |
protected List<String> |
getTemplateNames(List<com.microsoft.azure.common.function.template.FunctionTemplate> templates) |
protected List<com.microsoft.azure.common.function.template.FunctionTemplate> |
loadAllFunctionTemplates() |
protected void |
prepareFunctionName() |
protected void |
preparePackageName() |
protected Map<String,String> |
prepareRequiredParameters(com.microsoft.azure.common.function.template.FunctionTemplate template,
com.microsoft.azure.common.function.template.BindingTemplate bindingTemplate) |
protected Map<String,String> |
prepareTemplateParameters(com.microsoft.azure.common.function.template.FunctionTemplate template,
com.microsoft.azure.common.function.template.BindingTemplate bindingTemplate,
Map<String,String> params) |
protected void |
saveNewFunctionToFile(String newFunctionClass) |
protected void |
saveToTargetFile(File targetFile,
String newFunctionClass) |
protected void |
setFunctionName(String functionName) |
protected void |
setFunctionPackageName(String functionPackageName) |
protected void |
setFunctionTemplate(String functionTemplate) |
protected String |
substituteParametersInTemplate(com.microsoft.azure.common.function.template.FunctionTemplate template,
Map<String,String> params) |
getAppInsightsInstance, getAppInsightsKey, getFinalName, getFunctionApp, getPricingTier, getRegion, getRuntime, getTelemetryProperties, isDisableAppInsights, isSkipMojo, validateAppNamegetAppName, getAppServicePlanName, getAppServicePlanResourceGroup, getAppSettings, getDeploymentSlotSetting, getDeploymentStagingDirectoryPath, getDeploymentType, getPortalUrl, getResourceGroup, getResourcePortalUrl, getResources, setDeploymentSlotexecute, executeWithTimeRecorder, getAuthenticationSetting, getAuthMethod, getAuthType, getAzureClient, getAzureCredentialWrapper, getBuildDirectoryAbsolutePath, getHttpProxyHost, getHttpProxyPort, getInstallationId, getMavenResourcesFiltering, getOrCreateAzureClient, getPluginName, getPluginVersion, getProject, getSession, getSessionId, getSettings, getSubscriptionId, getTelemetryProxy, getUserAgent, handleException, highlightDefaultValue, infoWithMultipleLines, initTelemetry, isAuthConfigurationExist, isFailingOnError, isTelemetryAllowed, printCurrentSubscription, selectSubscription, trackMojoFailure, trackMojoSkip, trackMojoStart, trackMojoSuccessprivate static final String LOAD_TEMPLATES
private static final String LOAD_TEMPLATES_DONE
private static final String FIND_TEMPLATE
private static final String FIND_TEMPLATE_DONE
private static final String FIND_TEMPLATE_FAIL
private static final String PREPARE_PARAMS
private static final String FOUND_VALID_VALUE
private static final String SAVE_FILE
private static final String SAVE_FILE_DONE
private static final String FILE_EXIST
private static final String DEFAULT_INPUT_ERROR_MESSAGE
private static final String PROMPT_STRING_WITH_DEFAULTVALUE
private static final String PROMPT_STRING_WITHOUT_DEFAULTVALUE
private static final String FUNCTION_NAME_REGEXP
@Parameter(defaultValue="${project.basedir}",
readonly=true,
required=true)
protected File basedir
@Parameter(defaultValue="${project.compileSourceRoots}",
readonly=true,
required=true)
protected List<String> compileSourceRoots
@Parameter(property="functions.package") protected String functionPackageName
@Parameter(property="functions.name") protected String functionName
@Parameter(property="functions.template") protected String functionTemplate
public String getFunctionPackageName()
public String getFunctionName()
public String getClassName()
public String getFunctionTemplate()
protected String getBasedir()
protected String getSourceRoot()
protected void setFunctionPackageName(String functionPackageName)
protected void setFunctionName(String functionName)
protected void setFunctionTemplate(String functionTemplate)
protected void doExecute()
throws com.microsoft.azure.common.exceptions.AzureExecutionException
doExecute in class AbstractAzureMojocom.microsoft.azure.common.exceptions.AzureExecutionExceptionprotected List<com.microsoft.azure.common.function.template.FunctionTemplate> loadAllFunctionTemplates() throws com.microsoft.azure.common.exceptions.AzureExecutionException
com.microsoft.azure.common.exceptions.AzureExecutionExceptionprotected com.microsoft.azure.common.function.template.FunctionTemplate getFunctionTemplate(List<com.microsoft.azure.common.function.template.FunctionTemplate> templates) throws IOException, com.microsoft.azure.common.exceptions.AzureExecutionException, org.apache.maven.plugin.MojoFailureException
IOExceptioncom.microsoft.azure.common.exceptions.AzureExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected List<String> getTemplateNames(List<com.microsoft.azure.common.function.template.FunctionTemplate> templates)
protected com.microsoft.azure.common.function.template.FunctionTemplate findTemplateByName(List<com.microsoft.azure.common.function.template.FunctionTemplate> templates, String templateName) throws com.microsoft.azure.common.exceptions.AzureExecutionException
com.microsoft.azure.common.exceptions.AzureExecutionExceptionprotected Map<String,String> prepareRequiredParameters(com.microsoft.azure.common.function.template.FunctionTemplate template, com.microsoft.azure.common.function.template.BindingTemplate bindingTemplate) throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureExceptionprotected void prepareFunctionName()
throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureExceptionprotected void preparePackageName()
throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureExceptionprotected Map<String,String> prepareTemplateParameters(com.microsoft.azure.common.function.template.FunctionTemplate template, com.microsoft.azure.common.function.template.BindingTemplate bindingTemplate, Map<String,String> params) throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureExceptionprotected String getStringInputFromUser(String attributeName, String initValue, com.microsoft.azure.common.function.template.FunctionSettingTemplate template)
protected String getStringInputErrorMessage(com.microsoft.azure.common.function.template.FunctionSettingTemplate template)
protected String getStringInputPromptString(String attributeName, String defaultValue)
protected java.util.function.Function<String,Boolean> getStringInputValidator(com.microsoft.azure.common.function.template.FunctionSettingTemplate template)
protected String substituteParametersInTemplate(com.microsoft.azure.common.function.template.FunctionTemplate template, Map<String,String> params)
protected void saveNewFunctionToFile(String newFunctionClass) throws IOException, com.microsoft.azure.common.exceptions.AzureExecutionException
IOExceptioncom.microsoft.azure.common.exceptions.AzureExecutionExceptionprotected File getPackageDir()
protected File getTargetFile(File packageDir) throws com.microsoft.azure.common.exceptions.AzureExecutionException
com.microsoft.azure.common.exceptions.AzureExecutionExceptionprotected void createPackageDirIfNotExist(File packageDir)
protected void saveToTargetFile(File targetFile, String newFunctionClass) throws IOException
IOExceptionprotected void assureInputFromUser(String prompt, String initValue, List<String> options, java.util.function.Consumer<String> setter)
protected void assureInputFromUser(String prompt, String initValue, java.util.function.Function<String,Boolean> validator, String errorMessage, java.util.function.Consumer<String> setter)
protected void assureInputInBatchMode(String input, java.util.function.Function<String,Boolean> validator, java.util.function.Consumer<String> setter, boolean required) throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureExceptionprotected Scanner getScanner()
@Nullable private String findElementInOptions(List<String> options, String item)
Copyright © 2021. All rights reserved.