@Mojo(name="package",
defaultPhase=PACKAGE,
requiresDependencyResolution=RUNTIME)
public class PackageMojo
extends AbstractFunctionMojo
AbstractAzureMojo.DefaultUncaughtExceptionHandler, AbstractAzureMojo.RunnableWithExceptionalwaysReadyInstances, 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 |
|---|
PackageMojo() |
| Modifier and Type | Method and Description |
|---|---|
static void |
buildArtifactWithDependencies(File artifactFile,
Set<File> dependencies,
File target) |
private void |
copyArtifactToStagingDirectory(File stagingDirectory,
Set<File> dependencies) |
private void |
copyDependenciesToStagingDirectory(File stagingDirectory,
Set<File> dependencies) |
private static void |
copyFilesWithDefaultContent(File source,
File dest,
String defaultContent) |
private static void |
copyFileToDirectory(File srcFile,
File destFile) |
protected void |
copyHostJson() |
protected void |
copyJarsToStageDirectory() |
protected void |
copyLocalSettingsJson() |
protected void |
doExecute() |
protected Set<Method> |
findAnnotatedMethods(AnnotationHandler handler) |
protected AnnotationHandler |
getAnnotationHandler() |
protected URL |
getArtifactUrl() |
private static List<org.apache.maven.plugins.shade.resource.ResourceTransformer> |
getDefaultResourceTransformers() |
protected List<URL> |
getDependencyArtifactUrls() |
private static org.apache.maven.plugins.shade.filter.Filter |
getExcludeSignFilesFilter(Set<File> jars) |
protected Set<BindingEnum> |
getFunctionBindingEnums(Map<String,FunctionConfiguration> configMap) |
protected Map<String,FunctionConfiguration> |
getFunctionConfigurations(AnnotationHandler handler,
Set<Method> methods) |
protected FunctionCoreToolsHandler |
getFunctionCoreToolsHandler(CommandHandler commandHandler) |
protected com.fasterxml.jackson.databind.ObjectWriter |
getObjectWriter() |
List<DeploymentResource> |
getResources() |
protected String |
getScriptFilePath() |
protected URL |
getTargetClassUrl() |
protected void |
installExtension(FunctionCoreToolsHandler handler,
Set<BindingEnum> bindingEnums) |
protected boolean |
isInstallingExtensionNeeded(Set<BindingEnum> bindingTypes) |
protected void |
promptCompileInfo() |
protected void |
trackFunctionProperties(Map<String,FunctionConfiguration> configMap) |
protected void |
validateFunctionConfigurations(Map<String,FunctionConfiguration> configMap) |
protected void |
writeFunctionJsonFile(com.fasterxml.jackson.databind.ObjectWriter objectWriter,
String functionName,
FunctionConfiguration config) |
protected void |
writeFunctionJsonFiles(com.fasterxml.jackson.databind.ObjectWriter objectWriter,
Map<String,FunctionConfiguration> configMap) |
protected void |
writeObjectToFile(com.fasterxml.jackson.databind.ObjectWriter objectWriter,
Object object,
File targetFile) |
getAppInsightsInstance, getAppInsightsKey, getArtifact, getBundleVersion, getFinalName, getFunctionLibraryVersion, getHostJsonFile, getLocalSettingsJsonFile, getRegion, getRuntimeConfiguration, getTelemetryProperties, isDisableAppInsights, isSkipMojo, readHostJson, validateAppName, validateFunctionCompatibilitygetAppName, getAppServicePlanName, getAppServicePlanResourceGroup, getAppSettings, getDeploymentSlotSetting, getDeploymentStagingDirectoryPath, getResourceGroup, 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, validateArtifactCompileVersionpublic static final String SEARCH_FUNCTIONS
public static final String FOUND_FUNCTIONS
public static final String NO_FUNCTIONS
public static final String GENERATE_CONFIG
public static final String GENERATE_SKIP
public static final String GENERATE_DONE
public static final String VALIDATE_CONFIG
public static final String VALIDATE_SKIP
public static final String VALIDATE_DONE
public static final String SAVING_HOST_JSON
public static final String SAVING_LOCAL_SETTINGS_JSON
public static final String SAVE_FUNCTION_JSONS
public static final String SAVE_SKIP
public static final String SAVE_FUNCTION_JSON
public static final String SAVE_SUCCESS
public static final String COPY_JARS
public static final String COPY_SUCCESS
public static final String INSTALL_EXTENSIONS
public static final String SKIP_INSTALL_EXTENSIONS_HTTP
public static final String INSTALL_EXTENSIONS_FINISH
public static final String BUILD_SUCCESS
public static final String FUNCTION_JSON
public static final String EXTENSION_BUNDLE
private static final String AZURE_FUNCTIONS_JAVA_CORE_LIBRARY
private static final String DEFAULT_LOCAL_SETTINGS_JSON
private static final String DEFAULT_HOST_JSON
private static final BindingEnum[] FUNCTION_WITHOUT_FUNCTION_EXTENSION
private static final String EXTENSION_BUNDLE_ID
private static final String EXTENSION_BUNDLE_PREVIEW_ID
private static final String SKIP_INSTALL_EXTENSIONS_FLAG
private static final String SKIP_INSTALL_EXTENSIONS_BUNDLE
private static final String BUILD_UBER_ARTIFACT_EXCEPTION
@Parameter(property="functions.skipInstallExtensions",
defaultValue="false")
protected Boolean skipInstallExtensions
@Parameter(property="functions.skipCopyDependencies",
defaultValue="false")
protected Boolean skipCopyDependencies
@Parameter(property="functions.buildJarWithDependencies",
defaultValue="false")
protected Boolean buildJarWithDependencies
protected void doExecute()
throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
doExecute in class AbstractAzureMojocom.microsoft.azure.toolkit.lib.common.exception.AzureExecutionExceptionpublic static void buildArtifactWithDependencies(@Nonnull File artifactFile, @Nullable Set<File> dependencies, File target)
private static List<org.apache.maven.plugins.shade.resource.ResourceTransformer> getDefaultResourceTransformers()
private static org.apache.maven.plugins.shade.filter.Filter getExcludeSignFilesFilter(Set<File> jars)
protected AnnotationHandler getAnnotationHandler()
protected Set<Method> findAnnotatedMethods(AnnotationHandler handler) throws MalformedURLException
MalformedURLExceptionprotected URL getArtifactUrl() throws MalformedURLException
MalformedURLExceptionprotected URL getTargetClassUrl() throws MalformedURLException
MalformedURLExceptionprotected List<URL> getDependencyArtifactUrls()
protected Map<String,FunctionConfiguration> getFunctionConfigurations(AnnotationHandler handler, Set<Method> methods) throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionExceptionprotected String getScriptFilePath()
protected void validateFunctionConfigurations(Map<String,FunctionConfiguration> configMap)
protected void writeFunctionJsonFiles(com.fasterxml.jackson.databind.ObjectWriter objectWriter,
Map<String,FunctionConfiguration> configMap)
throws IOException
IOExceptionprotected void writeFunctionJsonFile(com.fasterxml.jackson.databind.ObjectWriter objectWriter,
String functionName,
FunctionConfiguration config)
throws IOException
IOExceptionprotected void copyHostJson()
throws IOException
IOExceptionprotected void copyLocalSettingsJson()
throws IOException
IOExceptionprivate static void copyFilesWithDefaultContent(File source, File dest, String defaultContent) throws IOException
IOExceptionprotected void writeObjectToFile(com.fasterxml.jackson.databind.ObjectWriter objectWriter,
Object object,
File targetFile)
throws IOException
IOExceptionprotected com.fasterxml.jackson.databind.ObjectWriter getObjectWriter()
protected void copyJarsToStageDirectory()
throws IOException,
org.apache.maven.plugin.MojoExecutionException
IOExceptionorg.apache.maven.plugin.MojoExecutionExceptionprivate void copyDependenciesToStagingDirectory(@Nonnull File stagingDirectory, @Nullable Set<File> dependencies) throws IOException
IOExceptionprivate void copyArtifactToStagingDirectory(@Nonnull File stagingDirectory, @Nullable Set<File> dependencies) throws IOException
IOExceptionpublic List<DeploymentResource> getResources()
getResources in class AbstractAppServiceMojoprotected FunctionCoreToolsHandler getFunctionCoreToolsHandler(CommandHandler commandHandler)
protected void installExtension(FunctionCoreToolsHandler handler, Set<BindingEnum> bindingEnums) throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionExceptionprotected Set<BindingEnum> getFunctionBindingEnums(Map<String,FunctionConfiguration> configMap)
protected boolean isInstallingExtensionNeeded(Set<BindingEnum> bindingTypes)
protected void promptCompileInfo()
protected void trackFunctionProperties(Map<String,FunctionConfiguration> configMap)
Copyright © 2024. All rights reserved.