@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_DEFAULT_VALUE |
private static String |
PROMPT_STRING_WITHOUT_DEFAULT_VALUE |
private static String |
SAVE_FILE |
private static String |
SAVE_FILE_DONE |
alwaysReadyInstances, appInsightsInstance, appInsightsKey, artifactPath, AZURE_FUNCTIONS_JAVA_LIBRARY, CAN_NOT_FIND_ARTIFACT, disableAppInsights, enableDistributedTracing, environment, finalName, FUNCTION_EXTENSION_LIBRARY_MAP, HOST_JSON, hostJson, instanceSize, LOCAL_SETTINGS_JSON, localSettingsJson, maximumInstances, maxReplicas, minReplicas, outputDirectory, parser, pricingTier, region, runtime, skip, storageAccountName, storageAccountResourceGroup, TRIGGER_TYPEappName, appServiceClient, appServicePlanName, appServicePlanResourceGroup, appSettings, deploymentSlotSetting, MAVEN_PLUGIN_POSTFIX, resourceGroupallowTelemetry, auth, authType, buildDirectory, COMPILE_LEVEL_NOT_SUPPORTED, FAILED_TO_GET_VALID_RUNTIMES, failsOnError, failsOnRuntimeValidationError, 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_TEMPLATE, subscriptionId, telemetries, telemetryProxy, USING_AZURE_ENVIRONMENT| Constructor and Description |
|---|
AddMojo() |
getAppInsightsInstance, getAppInsightsKey, getArtifact, getBundleVersion, getFinalName, getFunctionLibraryVersion, getHostJsonFile, getLocalSettingsJsonFile, getRegion, getRuntimeConfiguration, getTelemetryProperties, isDisableAppInsights, isSkipMojo, readHostJson, validateAppName, validateFunctionCompatibilitygetAppName, getAppServicePlanName, getAppServicePlanResourceGroup, getAppSettings, getDeploymentSlotSetting, getDeploymentStagingDirectoryPath, getResourceGroup, getResources, initAzureAppServiceClient, printCurrentSubscriptionafterMojoExecution, beforeMojoExecution, checkSubscription, execute, executeWithTimeRecorder, getActualAuthType, getAllowTelemetry, getBuildDirectoryAbsolutePath, getCompileLevel, getFailsOnError, getFailsOnRuntimeValidationError, getInstallationId, getMavenResourcesFiltering, getPluginName, getPluginVersion, getProject, getSession, getSessionId, getSettings, getSubscriptionId, getTargetSubscriptionId, getTelemetries, getTelemetryProxy, getUserAgent, getValidRuntimes, highlightDefaultValue, infoWithMultipleLines, initTelemetryProxy, loginAzure, loginAzure, onMojoError, onSkipped, printCredentialDescription, selectSubscription, selectSubscription, trackMojoFailure, updateTelemetryProperties, validateArtifactCompileVersionprivate 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_DEFAULT_VALUE
private static final String PROMPT_STRING_WITHOUT_DEFAULT_VALUE
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.toolkit.lib.common.exception.AzureExecutionException
doExecute in class AbstractAzureMojocom.microsoft.azure.toolkit.lib.common.exception.AzureExecutionExceptionprotected List<FunctionTemplate> loadAllFunctionTemplates(FunctionExtensionVersion bundleVersion) throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionExceptionprotected FunctionTemplate getFunctionTemplate(List<FunctionTemplate> templates) throws IOException, com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException, org.apache.maven.plugin.MojoFailureException
IOExceptioncom.microsoft.azure.toolkit.lib.common.exception.AzureExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected List<String> getTemplateNames(List<FunctionTemplate> templates)
protected FunctionTemplate findTemplateByName(List<FunctionTemplate> templates, String templateName) throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionExceptionprotected Map<String,String> prepareRequiredParameters(FunctionTemplate 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(FunctionTemplate template, BindingTemplate bindingTemplate, Map<String,String> params) throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureExceptionprotected String getStringInputFromUser(String attributeName, String initValue, FunctionSettingTemplate template)
protected String getStringInputErrorMessage(FunctionSettingTemplate template)
protected String getStringInputPromptString(String attributeName, String defaultValue)
protected java.util.function.Function<String,Boolean> getStringInputValidator(FunctionSettingTemplate template)
protected String substituteParametersInTemplate(FunctionTemplate template, Map<String,String> params)
protected void saveNewFunctionToFile(String newFunctionClass) throws IOException, com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
IOExceptioncom.microsoft.azure.toolkit.lib.common.exception.AzureExecutionExceptionprotected File getPackageDir()
protected File getTargetFile(File packageDir) throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
com.microsoft.azure.toolkit.lib.common.exception.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 © 2024. All rights reserved.