@Mojo(name="add") public class AddMojo extends AbstractFunctionMojo
| Modifier and Type | Field and Description |
|---|---|
protected File |
basedir |
protected List<String> |
compileSourceRoots |
static String |
DEFAULT_INPUT_ERROR_MESSAGE |
static String |
FILE_EXIST |
static String |
FIND_TEMPLATE |
static String |
FIND_TEMPLATE_DONE |
static String |
FIND_TEMPLATE_FAIL |
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
|
static String |
LOAD_BINDING_TEMPLATES_FAIL |
static String |
LOAD_TEMPLATES |
static String |
LOAD_TEMPLATES_DONE |
static String |
LOAD_TEMPLATES_FAIL |
static String |
PREPARE_PARAMS |
static String |
PROMPT_STRING_WITH_DEFAULTVALUE |
static String |
PROMPT_STRING_WITHOUT_DEFAULTVALUE |
static String |
SAVE_FILE |
static String |
SAVE_FILE_DONE |
finalName, outputDirectory, pricingTier, region, skipappName, appServicePlanName, appServicePlanResourceGroup, appSettings, deploymentType, MAVEN_PLUGIN_POSTFIX, resourceGroupallowTelemetry, AUTH_TYPE, authentication, AZURE_INIT_FAIL, buildDirectory, failsOnError, FAILURE_REASON, httpProxyHost, httpProxyPort, INIT_FAILURE, INSTALLATION_ID_KEY, mavenResourcesFiltering, plugin, PLUGIN_NAME_KEY, PLUGIN_VERSION_KEY, project, session, SESSION_ID_KEY, settings, SUBSCRIPTION_ID_KEY, subscriptionId, TELEMETRY_NOT_ALLOWED| Constructor and Description |
|---|
AddMojo() |
checkJavaVersion, execute, getFinalName, getFunctionApp, getPricingTier, getRegion, isSkipMojogetAppName, getAppServicePlanName, getAppServicePlanResourceGroup, getAppSettings, getDeploymentStagingDirectoryPath, getDeploymentType, getResourceGroup, getResourcesdebug, error, getAuthenticationSetting, getAuthType, getAzureClient, getBuildDirectoryAbsolutePath, getHttpProxyHost, getHttpProxyPort, getInstallationId, getMavenResourcesFiltering, getPluginName, getPluginVersion, getProject, getSession, getSessionId, getSettings, getSubscriptionId, getTelemetryProperties, getTelemetryProxy, getUserAgent, handleException, info, infoWithMultipleLines, initTelemetry, isFailingOnError, isTelemetryAllowed, trackMojoFailure, trackMojoSkip, trackMojoStart, trackMojoSuccess, warninggetLog, getPluginContext, setLog, setPluginContextpublic static final String LOAD_TEMPLATES
public static final String LOAD_TEMPLATES_DONE
public static final String LOAD_TEMPLATES_FAIL
public static final String FIND_TEMPLATE
public static final String FIND_TEMPLATE_DONE
public static final String FIND_TEMPLATE_FAIL
public static final String LOAD_BINDING_TEMPLATES_FAIL
public static final String PREPARE_PARAMS
public static final String FOUND_VALID_VALUE
public static final String SAVE_FILE
public static final String SAVE_FILE_DONE
public static final String FILE_EXIST
public static final String DEFAULT_INPUT_ERROR_MESSAGE
public static final String PROMPT_STRING_WITH_DEFAULTVALUE
public 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 Exception
doExecute in class com.microsoft.azure.maven.AbstractAzureMojoExceptionprotected BindingTemplate loadBindingTemplate(String type)
protected List<FunctionTemplate> loadAllFunctionTemplates() throws Exception
Exceptionprotected List<FunctionTemplate> parseTemplateJson(String templateJson) throws Exception
Exceptionprotected FunctionTemplate getFunctionTemplate(List<FunctionTemplate> templates) throws Exception
Exceptionprotected List<String> getTemplateNames(List<FunctionTemplate> templates)
protected FunctionTemplate findTemplateByName(List<FunctionTemplate> templates, String templateName) throws Exception
Exceptionprotected 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 Exception
Exceptionprotected File getPackageDir()
protected void createPackageDirIfNotExist(File packageDir)
protected void saveToTargetFile(File targetFile, String newFunctionClass) throws Exception
Exceptionprotected 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 © 2019. All rights reserved.