Class PackageMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="package",
          defaultPhase=PACKAGE,
          requiresDependencyResolution=RUNTIME)
    public class PackageMojo
    extends AbstractFunctionMojo
    Generate configuration files (host.json, function.json etc.) and copy JARs to staging directory.
    • Constructor Detail

      • PackageMojo

        public PackageMojo()
    • Method Detail

      • doExecute

        protected void doExecute()
                          throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
        Specified by:
        doExecute in class com.microsoft.azure.maven.AbstractAzureMojo
        Throws:
        com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
      • buildArtifactWithDependencies

        public static void buildArtifactWithDependencies​(@Nonnull
                                                         File artifactFile,
                                                         @Nullable
                                                         Set<File> dependencies,
                                                         File target)
      • getDefaultResourceTransformers

        private static List<org.apache.maven.plugins.shade.resource.ResourceTransformer> getDefaultResourceTransformers()
      • getExcludeSignFilesFilter

        private static org.apache.maven.plugins.shade.filter.Filter getExcludeSignFilesFilter​(Set<File> jars)
      • getAnnotationHandler

        protected com.microsoft.azure.toolkit.lib.legacy.function.handlers.AnnotationHandler getAnnotationHandler()
      • getDependencyArtifactUrls

        protected List<URL> getDependencyArtifactUrls()
        Returns:
        URLs for the classpath with compile scope needed jars
      • getFunctionConfigurations

        protected Map<String,​com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionConfiguration> getFunctionConfigurations​(com.microsoft.azure.toolkit.lib.legacy.function.handlers.AnnotationHandler handler,
                                                                                                                                                   Set<Method> methods)
                                                                                                                                            throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
        Throws:
        com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
      • getScriptFilePath

        protected String getScriptFilePath()
      • validateFunctionConfigurations

        protected void validateFunctionConfigurations​(Map<String,​com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionConfiguration> configMap)
      • writeFunctionJsonFiles

        protected void writeFunctionJsonFiles​(com.fasterxml.jackson.databind.ObjectWriter objectWriter,
                                              Map<String,​com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionConfiguration> configMap)
                                       throws IOException
        Throws:
        IOException
      • writeFunctionJsonFile

        protected void writeFunctionJsonFile​(com.fasterxml.jackson.databind.ObjectWriter objectWriter,
                                             String functionName,
                                             com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionConfiguration config)
                                      throws IOException
        Throws:
        IOException
      • writeObjectToFile

        protected void writeObjectToFile​(com.fasterxml.jackson.databind.ObjectWriter objectWriter,
                                         Object object,
                                         File targetFile)
                                  throws IOException
        Throws:
        IOException
      • getObjectWriter

        protected com.fasterxml.jackson.databind.ObjectWriter getObjectWriter()
      • copyJarsToStageDirectory

        protected void copyJarsToStageDirectory()
                                         throws IOException,
                                                org.apache.maven.plugin.MojoExecutionException
        Throws:
        IOException
        org.apache.maven.plugin.MojoExecutionException
      • getResources

        public List<com.microsoft.azure.maven.model.DeploymentResource> getResources()
        Overrides:
        getResources in class com.microsoft.azure.maven.appservice.AbstractAppServiceMojo
      • getFunctionCoreToolsHandler

        protected com.microsoft.azure.toolkit.lib.legacy.function.handlers.FunctionCoreToolsHandler getFunctionCoreToolsHandler​(com.microsoft.azure.toolkit.lib.legacy.function.handlers.CommandHandler commandHandler)
      • installExtension

        protected void installExtension​(com.microsoft.azure.toolkit.lib.legacy.function.handlers.FunctionCoreToolsHandler handler,
                                        Set<com.microsoft.azure.toolkit.lib.legacy.function.bindings.BindingEnum> bindingEnums)
                                 throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
        Throws:
        com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
      • getFunctionBindingEnums

        protected Set<com.microsoft.azure.toolkit.lib.legacy.function.bindings.BindingEnum> getFunctionBindingEnums​(Map<String,​com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionConfiguration> configMap)
      • isInstallingExtensionNeeded

        protected boolean isInstallingExtensionNeeded​(Set<com.microsoft.azure.toolkit.lib.legacy.function.bindings.BindingEnum> bindingTypes)
      • promptCompileInfo

        protected void promptCompileInfo()
      • trackFunctionProperties

        protected void trackFunctionProperties​(Map<String,​com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionConfiguration> configMap)