Giter VIP home page Giter VIP logo

azure-maven-plugins's Introduction

Maven Plugins for Azure Services

Build Status Gitter

This repository contains all Maven plugins for Microsoft Azure services.

Related repository: azure-maven-archetypes

You may be also interested in the Azure Maven Archetypes. These plugins are very closely related to the archetypes, and both kinds of artifacts work together to give you Java your way on Azure.

For more information on authentication, common configurations, CI CD, and general plugin documentation, see the Wiki.

Plugins

Maven Plugin Maven Central Version Build Status
Maven Plugin for Azure Web Apps Maven Central AppVeyor Webapp Plugin
Maven Plugin for Azure Functions Maven Central AppVeyor Function Plugin
Maven Plugin for Azure Spring Apps Maven Central

Authentication

All the Azure Maven plugins share the same authentication logic. There are 4 authentication methods by priority order:

  1. Service Principles in plugin configuration
  2. Service Principles in settings.xml (Recommended for production use)
  3. Maven Plugin for Azure Account (Default if no other method are used)
  4. Azure CLI

For example, if you have not only Service Principles configured in your plugin configuration, but also Azure CLI installed and logged in, the Azure Maven plugins will use the Service Principles in your plugin configuration.

If no credential found, Azure Maven plugins will automatically log you in with the third method like OAuth or DeviceLogin provided by Maven Plugin for Azure Account.

AuthType (since Web App 1.9.0)

You can specify which authentication method to use with in Maven configuration, the default value is auto, and here are all the valid values:

  • service_principal
    • Will use credential specified in plugin configuration or Maven settings.xml, this is also the first priority authentication method in auto
  • azure_auth_maven_plugin
    • Will use credential provided by Azure Auth Maven Plugin, it will first consume existing secret files, and will guide you auth with Oath or Device Login if you hadn't authenticated with Auth Maven Plugin before.
  • azure_cli
    • Will use credential provided by Azure CLI, this could also be used in Azure Cloud Shell.
  • auto
    • Will try all the auth methods in the following sequence: service_principal, azure_auth_maven_plugin(existing secret files), azure_cli, azure_auth_maven_plugin

Maven plugin will only try the specific authentication method (except auto) if is set in configuration.

See the Authentication section in our wiki for more information.

Common Configurations

The three Maven Plugins for Azure Web App/Functions/Spring Apps support below configuration properties.

Property Required Description Version
<subscriptionId> false Specifies the target subscription.
Use this setting when you have multiple subscriptions in your authentication file.
WebApp: 0.1.0
Function: 0.1.0
Spring: 1.0.0
<allowTelemetry> false Specifies whether to allow this plugin to send telemetry data; default value is true. WebApp: 0.1.0
Function: 0.1.0
Spring: 1.0.0
<auth> false Specifies auth configuration. For more info, please refer to here. WebApp:0.1.0
Function:0.1.0
<authType> false Specifies which authentication method to use, default value is auto. For more infos, please refer to here. WebApp:1.9.0
<skip> false Specifies whether to skip execution. Default value is false. WebApp: 0.1.4
Function: 0.1.0

Feedback and Questions

To report bugs or request new features, file issues on Issues. Or, ask questions on Stack Overflow with tag azure-java-tools.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once in all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Telemetry

This project collects usage data and sends it to Microsoft to help improve our products and services. Read Microsoft's privacy statement to learn more. If you would like to opt out of sending telemetry data to Microsoft, you can set allowTelemetry to false in the plugin configuration. Please read our documents to find more details.

azure-maven-plugins's People

Contributors

akashneil avatar andxu avatar ashiquemd avatar brunoborges avatar dependabot[bot] avatar flanker32 avatar glqdlt avatar hkhmsft avatar ivywei0125 avatar jazzyray avatar jdneo avatar jdubois avatar mastercartop avatar matthew-dong avatar microsoft-github-policy-service[bot] avatar mjg123 avatar patrickherrera avatar pragnagopa avatar rapatchi avatar rmcmurray avatar shenqianjin avatar tsuyoshiushio avatar vrdmr avatar wangmingliang-ms avatar wezhang avatar xscript avatar xuachen avatar yucwan avatar yusuketobo avatar zhijunzhao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-maven-plugins's Issues

The default functions has wrong behave to handle param given in url

Plugin name and version

Maven Plugin for Azure Functions

Plugin configuration in your pom.xml

pom.txt(the default maven create)

Expected behavior

when running the function,and excute the command "curl http://localhost:7071/api/hello?req=world", it should return "Hello, world"

Actual behavior

get the 400 response

Steps to reproduce the problem

with the guideline https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven , the default function created by maven is below:
`@FunctionName("hello")
public HttpResponseMessage hello(@HttpTrigger(name = "req", methods = {"get", "post"}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage request,
final ExecutionContext context) {
context.getLogger().info("Java HTTP trigger processed a request.");

    // Parse query parameter
    String name = request.getQueryParameters().get("name");

    if (name == null) {
        // Get request body
        Object body = request.getBody();
        if (body != null) {
            name = body.toString();
        }
    }

    if (name == null) {
        return request.createResponse(400, "Please pass a name on the query string or in the request body");
    } else {
        return request.createResponse(200, "Hello, " + name);
    }
}`
  1. there is a confuse: why the parameter key is named "name" in code rather than“req”
    String name = request.getQueryParameters().get("name");"

  2. If I change the code "String name = request.getQueryParameters().get("name");" to be "String name = request.getQueryParameters().get("req");"
    and excute the command "curl http://localhost:7071/api/hello?req=world", then it get 400 response,that is it can not get the parameter "req".That is, the function can only handle the "name" param

Plugin name

Should we use a simple algorithm for naming these plugins:

Maven plugin for [AZURE-SERVICE-NAME]

Say

  • Maven plugin for Azure App Service
  • Maven plugin for Azure Functions
  • ...

Azure Maven Plugin for Web Apps Does NOT Allow the Use of Existing App Service Plans

Plugin name and version

Azure Maven Plugin for Web Apps 0.1.5

Plugin configuration in your pom.xml

Any configuration

Expected behavior

Should allow the use of existing app service plans

Actual behavior

Does not allow the use of existing app service plans. It creates an app service plan for every deploy. This limits the use of the Maven plugin because there are subscription limits - https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits#app-service-limits. There are known issues to cleanup app service plans which further aggravates developers. We have run into these limits several times now and then had to open support tickets to clean up app service plans. This creates FRICTION for developers.

The Azure Management Libraries for Java make it simple to use existing App Service Plans.

Steps to reproduce the problem

Just keep running one of the sample deployments to Azure Web Apps

webapp:help output should be updated

It says:

This plugin has 2 goals:

webapp:deploy
  Goal which deploy specified docker image to a Linux web app in Azure.

webapp:help
  Display help information on webapp-maven-plugin.
  Call mvn webapp:help -Ddetail=true -Dgoal=<goal-name> to display parameter
  details.

Should say:

This plugin has 2 goals:

webapp:deploy - deploys a Web app to Azure App Service Linux or Windows
webapp:help - display help info for this plugin

$ mvn webapp:help -Ddetail=true -Dgoal=<goal-name> for details on parameters

Should also update parameter details to be consistent with this message

Create more human-friendly names for associated services

Can we get better default naming for the associated services? E.g. if I create a function with name ‘cda-dash-20180306183328080’, it’s annoying that the app service plan and storage account have hexadecimal names (e.g. 4d6a4bec396242779c5e), rather than something more sane, e.g. ‘cda-dash-20180306183328080-storage’.

The nice thing about this is that if a standard naming scheme was in practice, I wouldn’t have to upload my function using maven, wait to see what the hex names are, and then re-upload my app so that it can use the storage account – I could reasonably guess it in advance.

Update the function name validator

Plugin name and version

Function plugin - 0.1.8

According to the portal, the function name should follow:
It must start with a letter and can contain letters, numbers (0-9), dashes ("-"), and underscores ("_").
image

While the java function name can have '$' and not allow '-', so they are different.

Azure Functions Maven Plugin requires CLI authentication every time a new console session is open

Every time a console session is started, even though the CLI V2 (az) is authenticated, I get the following error:

Execution default-cli of goal com.microsoft.azure:azure-functions-maven-plugin:0.1.10:deploy failed: An API incompatibility was encountered while executing com.microsoft.azure:azure-functions-maven-plugin:0.1.10:deploy: java.lang.NoSuchMethodError: com.microsoft.aad.adal4j.AuthenticationResult.(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;Lcom/microsoft/aad/adal4j/UserInfo;Z)V

First it's worth mentioning that this is not a friendly error and it's hard to figure the reason out. The other thing is that it makes no sense having to authenticate every time a console session (cmd) is started. The CLI v2 API holds the authentication for a couple of days and the maven plugin should support that.

Plugin name and version

com.microsoft.azure:azure-functions-maven-plugin:0.1.10

Plugin configuration in your pom.xml

	<plugins>
		<plugin>
			<groupId>com.microsoft.azure</groupId>
			<artifactId>azure-functions-maven-plugin</artifactId>
			<configuration>
				<resourceGroup>xxxxxx</resourceGroup>
				<appName>${functionAppName}</appName>
				<region>${functionAppRegion}</region>
				<appSettings>
					<property>
						<name>FUNCTIONS_EXTENSION_VERSION</name>
						<value>beta</value>
					</property>
				</appSettings>
			</configuration>
			<executions>
				<execution>
					<id>package-functions</id>
					<goals>
						<goal>package</goal>
					</goals>
				</execution>
			</executions>

			<dependencies>
				<dependency>
					<groupId>org.apache.poi</groupId>
					<artifactId>poi</artifactId>
					<version>${apache.poi.version}</version>
				</dependency>

				<dependency>
					<groupId>org.apache.poi</groupId>
					<artifactId>poi-ooxml</artifactId>
					<version>${apache.poi.version}</version>
				</dependency>

				<dependency>
					<groupId>org.springframework</groupId>
					<artifactId>spring-jdbc</artifactId>
					<version>${spring.components.version}</version>
				</dependency>

				<dependency>
					<groupId>com.microsoft.sqlserver</groupId>
					<artifactId>mssql-jdbc</artifactId>
					<version>${mssql-jdbc.version}</version>
				</dependency>

				<dependency>
					<groupId>org.springframework</groupId>
					<artifactId>spring-beans</artifactId>
					<version>${spring.components.version}</version>
				</dependency>

				<dependency>
					<groupId>org.springframework</groupId>
					<artifactId>spring-context</artifactId>
					<version>${spring.components.version}</version>
				</dependency>

				<dependency>
					<groupId>org.springframework</groupId>
					<artifactId>spring-web</artifactId>
					<version>${spring.components.version}</version>
				</dependency>

				<dependency>
					<groupId>commons-dbcp</groupId>
					<artifactId>commons-dbcp</artifactId>
					<version>${commons.dbcp.version}</version>
				</dependency>
			</dependencies>
		</plugin>

Steps to reproduce the problem

Authenticate using az login, deploy an Azure function using Maven plugin. Close the CMD window and open another one, check that az is still authenticated however if you try to deploy your function, an error is shown. If you authenticate again via az login in the same CMD session, it works.

Error when Connect to localhost:2375

Error Message -> HttpHostConnectException: Connect to localhost:2375

Possible solution: enable Expose Docker Daemon on TCP://localhost:2375 without TLS

expose docker daemon

Documentation hint on not to deploy *-shaded.jar and original-*.jar

###copy-resources >3.0.2
I cannot get rid of original-*.jar on deployment.
So now two jars get deployed. I guess this is a documentation thing.

Plugin configuration in your pom.xml

</goals>
            <configuration>
              <overwrite>true</overwrite>
              <outputDirectory>${project.build.directory}/azure-functions/${functionAppName}</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}</directory>
                  <includes>
                    <include>local.settings.json</include>
                    <include>host.json</include>
                  </includes>
                  <excludes>
                    <exclude>original-*.jar</exclude>
                    <exclude>*-shared.jar</exclude>
                  </excludes>
                </resource>
              </resources>
            </configuration>

Expected behavior

Only one jar is deployed.

Actual behavior

The original jar is not removed.

Steps to reproduce the problem

mvn clean package output folder still contains two jars

A required class was missing while executing azure-functions-maven-plugin:0.1.10:package

Plugin name and version

azure-functions-maven-plugin

Plugin configuration in your pom.xml

<plugin>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-functions-maven-plugin</artifactId>
  <configuration>
    <resourceGroup>java-functions-group</resourceGroup>
    <appName>${functionAppName}</appName>
    <region>${functionAppRegion}</region>
    <appSettings>
      <property>
        <name>FUNCTIONS_EXTENSION_VERSION</name>
        <value>beta</value>
      </property>
    </appSettings>
  </configuration>
  <executions>
    <execution>
      <id>package-functions</id>
      <goals>
        <goal>package</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Expected behavior

Build Succeeded.

Actual behavior

Build Failed.

Steps to reproduce the problem

I'm facing the error A required class was missing while executing com.microsoft.azure:azure-functions-maven-plugin:0.1.10:package: org/springframework/context/ApplicationContext when using Spring framework in my functions.

Reproducer.zip
The error happens on mvn clean package and seems to be related to class scanning for annotations.

A reproducer is attached.

Full log bellow:
Reproducer.zip

Loaded jars under lib folder are not set on classpath after mvn azure-functions:run

Plugin name and version

azure-functions-maven-plugin v0.2.0

Plugin configuration in your pom.xml

<dependencies>
    <dependency>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-functions-java-core</artifactId>
        <version>[1.0.0-beta-1,1.0.0)</version>
    </dependency>
    <dependency>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-storage</artifactId>
        <version>7.0.0</version>
    </dependency>
</dependencies>
<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.0.2</version>
            </plugin>
            <plugin>
                <groupId>com.microsoft.azure</groupId>
                <artifactId>azure-functions-maven-plugin</artifactId>
                <version>0.2.0</version>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
        <plugin>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-functions-maven-plugin</artifactId>
            <configuration>
                <resourceGroup>${functionResourceGroup}</resourceGroup>
                <appName>${functionAppName}</appName>
                <region>${functionAppRegion}</region>
                <appSettings>
                    <property>
                        <name>FUNCTIONS_EXTENSION_VERSION</name>
                        <value>beta</value>
                    </property>
                </appSettings>
            </configuration>
            <executions>
                <execution>
                    <id>package-functions</id>
                    <goals>
                        <goal>package</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
                <execution>
                    <id>copy-resources</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>
                        <overwrite>true</overwrite>
                        <outputDirectory>${stagingDirectory}</outputDirectory>
                        <resources>
                            <resource>
                                <directory>${project.basedir}</directory>
                                <includes>
                                    <include>host.json</include>
                                    <include>local.settings.json</include>
                                </includes>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
                <execution>
                    <id>copy-bin</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>
                        <overwrite>true</overwrite>
                        <outputDirectory>${stagingDirectory}/bin</outputDirectory>
                        <resources>
                            <resource>
                                <directory>${project.basedir}/bin</directory>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>3.0.2</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${stagingDirectory}/lib</outputDirectory>
                        <overWriteReleases>false</overWriteReleases>
                        <overWriteSnapshots>false</overWriteSnapshots>
                        <overWriteIfNewer>true</overWriteIfNewer>
                        <includeScope>runtime</includeScope>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Expected behavior

Azure function which uses a class from any dependent jar (which in this case is azure-storage) fails to execute after starting it locally using mvn azure-functions:run

Actual behavior

While starting the azure function the dependent jars loaded in the lib folder (target/azure-functions/<function-name>/lib/) by mvn azure-functions:package should be added to the functions classpath. This doesn't seem to be happening, and failing to find the dependency makes the function hang indefinitely at the place where a class from a dependent jar is referenced.

As per the closing comment on #86, this should have work, and was suggested not to generate a fat-jar using the maven-shade-plugin

Steps to reproduce the problem

  • Generate a azure function using the documented archtype mvn archetype:generate -DarchetypeGroupId=com.microsoft.azure -DarchetypeArtifactId=azure-functions-archetype -DarchetypeVersion=1.8
  • Add a external dependency to the POM
  • Reference a class from the dependent JAR in the Function.java file generated by the archtype
  • Package and run the function using mvn azure-functions:package & mvn azure-functions:run
  • Call the function using HTTP GET
  • The function fails to respond

plugin does not honor ${git.commit.id.abbrev} in <imageName>

Plugin name and version

azure-webapp-maven-plugin 1.1.0

Plugin configuration in your pom.xml

		<docker.image.prefix>xxxxxx.azurecr.io</docker.image.prefix>
                <docker.image.name>azure-xxxxxx-xxxxxx</docker.image.name>
		<docker.image.tag>${git.commit.id.abbrev}-${maven.build.timestamp}</docker.image.tag>
		<docker.image>${docker.image.prefix}/${docker.image.name}</docker.image>

		<containerSettings>
			<imageName>${docker.image}:${docker.image.tag}</imageName>
			<serverId>${azure.cr.server}</serverId>
			<registryUrl>https://${docker.image.prefix}</registryUrl>
		</containerSettings>

Expected behavior

should be read git version as abbrev

Actual behavior

[INFO] 509-byte body:
{"id":"/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/gremlin-test-4-11/providers/Microsoft.Web/sites/azure-spring-cloud/config/appsettings","name":"appsettings","type":"Microsoft.Web/sites/config","location":"Japan East","tags":{},"properties":{"PORT":"8080","DOCKER_REGISTRY_SERVER_PASSWORD":"XXXXXXXXXXXXXXXXXXXXXXXX","DOCKER_REGISTRY_SERVER_URL":"https://XXXXXXX.azurecr.io","DOCKER_REGISTRY_SERVER_USERNAME":"XXXXXX","DOCKER_CUSTOM_IMAGE_NAME":"XXXXXX.azurecr.io/azure-spring-cloud:${git.commit.id.abbrev}-2018_05_08-01_55"}}

Steps to reproduce the problem

Use git.commit.id.abbrev in pom

including msssql driver needs weird code otherwise you get a class not found exception.

Plugin name and version

Plugin configuration in your pom.xml

Expected behavior

Not having to add:

  @SuppressWarnings("unchecked")
      Class< com.microsoft.sqlserver.jdbc.SQLServerDriver> clazz = (Class<SQLServerDriver>) Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
      logger.log(Level.FINE,clazz.getName() +" loaded");

Or have something like this documented.

Actual behavior

If I do not add the above code I get a ClassNotFoundException if I run this code via
mvn package azure-functions:run
When database access is done from the integration tests it works fine without.
See also comments in: Azure/azure-functions-java-worker#35

Steps to reproduce the problem

try to access a msssql database in azure in an integration test withouth and with this Class.forName(..).
Then try to run the same from within a function in the function runtime.

Dependency issue with DocumentDBInput vs cosmosdb on azure-functions-maven-plugin

Plugin name and version

azure-functions-maven-plugin (0.2.0)

Plugin configuration in your pom.xml

Expected behavior

Project should be packaged with all dependancies.

Actual behavior

Error as mentioned.

Steps to reproduce the problem

Started getting error after following commit on this repo.
rename documentdb to cosmosdb (#128)

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:43 min
[INFO] Finished at: 2018-04-19T21:48:43-06:00
[INFO] Final Memory: 56M/509M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:0.1.8:package (package-functions) on project **roomSync**: Execution package-functions of goal com.microsoft.azure:azure-functions-maven-plugin:0.1.8:package failed: A required class was missing while executing com.microsoft.azure:azure-functions-maven-plugin:0.1.8:package: com/microsoft/azure/serverless/functions/annotation/DocumentDBInput
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.microsoft.azure:azure-functions-maven-plugin:0.1.8
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: com.microsoft.azure.serverless.functions.annotation.DocumentDBInput

ROOT\WEB-INF\classes\com] could not be completely deleted.

Plugin name and version

azure-webapp-maven-plugin 1.0.3

Plugin configuration in your pom.xml

FTP -> azure webapp

Expected behavior

Undeploy the existing ROOT dir on server
Deploy WAR file
Be happy

Actual behavior

Server is not completing undeploy of ROOT due to locked class files:
D:\home\site\wwwroot\webapps\ROOT] could not be completely deleted. The presence of the remaining files may cause problems

Steps to reproduce the problem

This does not happen every time the project is deployed. Generally, rebuilding the project will get it to deploy correctly and complete the undeploy of ROOT from server before deploying the new ROOT.war

publish to azure via "mvn azure-functions:deploy" doesn't support service principal

Repeat the problem:

  1. login to azure through service principal (https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest#logging-in-with-a-service-principal)
  2. Run "mvn azure-functions:deploy" to deploy the function
  3. Error like "Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:0.2.0:deploy (default-cli) on project xxx: java.io.IOException: clientId is null or empty" will be fired

azure-maven-plugin cannot be used from subproject in multimodule project.

Plugin name and version

 <plugin>
          <groupId>com.microsoft.azure</groupId>
          <artifactId>azure-functions-maven-plugin</artifactId>
          <version>0.1.9</version>
        </plugin>

Plugin configuration in your `pom.xml

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <groupId>com.microsoft.azure</groupId>
          <artifactId>azure-functions-maven-plugin</artifactId>
          <version>0.1.9</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <!-- Use shade plugin to bundle dependencies -->
      <plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<transformers>
						<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
							<mainClass>no.identification.functions:EnrollmentFunctions</mainClass>
						</transformer>
					</transformers>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/*.SF</exclude>
								<exclude>META-INF/*.DSA</exclude>
								<exclude>META-INF/*.RSA</exclude>
							</excludes>
						</filter>
					</filters>
				</configuration>
			</plugin>
      <plugin>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-functions-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>package-functions</id>
            <goals>
              <goal>package</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <resourceGroup>java-functions-group</resourceGroup>
          <appName>${functionAppName}</appName>
          <region>${functionAppRegion}</region>
          <appSettings>
            <property>
              <name>FUNCTIONS_EXTENSION_VERSION</name>
              <value>beta</value>
            </property>
          </appSettings>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <overwrite>true</overwrite>
              <outputDirectory>${project.build.directory}/azure-functions/${functionAppName}</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}</directory>
                  <includes>
                    <include>host.json</include>
                    <include>local.settings.json</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

Expected behavior

As a developer I want to be able to use the azure-functions plugin in a multi module project.
Either fix or provide guidance on how to do this correctly.

Actual behavior

Packaging is probably not correct.

Steps to reproduce the problem

Sample project

Build and run with:

mvn --projects azfunctions-multimodulefunction --also-make-dependents clean package azure-functions:package azure-functions:run

It will run but when triggering the function from a browser with http://localhost:7071/api/hello?name=hans it will fail with a reflection error.
Probably because packaging does not work correctly now.

Workaround:

  1. Remove the functions project from the multi module project
  2. Make the functions project a stand alone project that refers the artifacts from the multi module project.
  3. Do a mvn clean package install on the multi module project.
  4. Do a mvn clean package azure-functions:package azure-functions:run on the function project

This workaround requires extra steps on the build environment instead of a one liner in Maven.

ConcurrentModificationException occurred

stacktrace:

Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442)
at java.util.HashMap$EntryIterator.next(HashMap.java:1476)
at java.util.HashMap$EntryIterator.next(HashMap.java:1474)
at com.microsoft.azure.maven.telemetry.AppInsightsProxy.mergeProperties(AppInsightsProxy.java:90)
at com.microsoft.azure.maven.telemetry.AppInsightsProxy.trackEvent(AppInsightsProxy.java:68)
at com.microsoft.azure.maven.telemetry.AppInsightsProxy.trackEvent(AppInsightsProxy.java:59)
at com.microsoft.azure.maven.AbstractAzureMojo.trackMojoFailure(AbstractAzureMojo.java:332)
at com.microsoft.azure.maven.AbstractAzureMojo.handleException(AbstractAzureMojo.java:344)
at com.microsoft.azure.maven.AbstractAzureMojo.execute(AbstractAzureMojo.java:293)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more

FTP deployment failure after function app

Files are uploaded to the root folder (D:\home) instead of the web content root (D:\home\site\wwwroot) when using FTP deployment right after a new function app is created, causing below error:

[ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:0.1.7:deploy (default-cli) on project functions-beta2: Status code 500, {"Code":"InternalServerError","Message":"{\"error\":{\"code\":\"InternalServerError\",\"message\":\"System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\\\\home\\\\site\\\\wwwroot'.\\r\\n   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\\r\\n   at System.IO.FileSystemEnumerableIterator`1.CommonInit()\\r\\n   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)\\r\\n   at System.IO.Directory.GetDirectories(String path)\\r\\n   at Kudu.Core.Helpers.PostDeploymentHelper.<SyncFunctionsTriggers>d__25.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at Kudu.Services.Functions.FunctionController.<SyncTriggers>d__16.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\"}}","Target":null,"Details":[{"Message":"{\"error\":{\"code\":\"InternalServerError\",\"message\":\"System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\\\\home\\\\site\\\\wwwroot'.\\r\\n   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\\r\\n   at System.IO.FileSystemEnumerableIterator`1.CommonInit()\\r\\n   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption
searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)\\r\\n   at System.IO.Directory.GetDirectories(String path)\\r\\n   at Kudu.Core.Helpers.PostDeploymentHelper.<SyncFunctionsTriggers>d__25.MoveNext()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at Kudu.Services.Functions.FunctionController.<SyncTriggers>d__16.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n
 at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from
previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\"}}"},{"Code":"InternalServerError"},{"ErrorEntity":{"Code":"InternalServerError","Message":"{\"error\":{\"code\":\"InternalServerError\",\"message\":\"System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\\\\home\\\\site\\\\wwwroot'.\\r\\n   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\\r\\n   at System.IO.FileSystemEnumerableIterator`1.CommonInit()\\r\\n   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)\\r\\n   at System.IO.Directory.GetDirectories(String paPS

Need refine error handling to deal with such case.

Upload static content into file storage

Should the maven plugin upload static content, e.g. html files, etc as part of the function upload, such that they can be accessed and returned from function calls? Perhaps this is already supported, but I can't find any documentation about where to place the html files so that they are submitted.

Support stopping web app before FTP deployment

When deploying web app via FTP, files are sometimes locked by IIS, such as #16, #36 .
Stopping the target web app before deployment will fix this issue.
A new configuration element called <stopAppBeforeDeployment> (not finalized; subject to change) can be added to provide such functionality to user. Default value should be false, because:

  • Stopping web app will make it unavailable, hence user should be fully aware and turn it on explicitly
  • It is only useful for certain scenarios, such as FTP deployment, or local file cache enabled. For Local Git deployment or MS Deploy, it is not necessary.

Build result of Azure Functions project depends on source code

In the attached project, result of mvn package (whether it succeeds or fails) somehow depends on contents of project source files (*.java, not even pom.xml).

Plugin name and version

azure-functions-maven-plugin:0.1.10

Plugin configuration in your pom.xml

Attached.

Expected behavior

Behaviour of mvn package does not change when project source is modified

Actual behavior

Build failure log attached.

Steps to reproduce the problem

  1. Download the archive
  2. Unpack the project, run mvn -e package, observe the error.
  3. Open Function.java source file and replace all contents of the class with a stub Azure function implementation that does nothing and succeeds (e.g. return request.createResponse(200, "OK")).
  4. Run mvn package again, observe build success.

Abstract classes from referred project cannot be used

Plugin name and version

 <plugin>
          <groupId>com.microsoft.azure</groupId>
          <artifactId>azure-functions-maven-plugin</artifactId>
          <version>0.1.9</version>
        </plugin>

Plugin configuration in your pom.xml

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <groupId>com.microsoft.azure</groupId>
          <artifactId>azure-functions-maven-plugin</artifactId>
          <version>0.1.9</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <!-- Use shade plugin to bundle dependencies -->
      <plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<transformers>
						<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
							<mainClass>no.identification.functions:EnrollmentFunctions</mainClass>
						</transformer>
					</transformers>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/*.SF</exclude>
								<exclude>META-INF/*.DSA</exclude>
								<exclude>META-INF/*.RSA</exclude>
							</excludes>
						</filter>
					</filters>
				</configuration>
			</plugin>
      <plugin>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-functions-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>package-functions</id>
            <goals>
              <goal>package</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <resourceGroup>java-functions-group</resourceGroup>
          <appName>${functionAppName}</appName>
          <region>${functionAppRegion}</region>
          <appSettings>
            <property>
              <name>FUNCTIONS_EXTENSION_VERSION</name>
              <value>beta</value>
            </property>
          </appSettings>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <overwrite>true</overwrite>
              <outputDirectory>${project.build.directory}/azure-functions/${functionAppName}</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}</directory>
                  <includes>
                    <include>host.json</include>
                    <include>local.settings.json</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

Expected behavior

The azure functions plugin should be able to package code that uses abstract classes and methods.

Actual behavior

mvn clean package azure-functions-package fails with an error about not being able to find the abstract class.

Note that doing a mvn clean compile test just works.
If you remove the abstract class it just works.

Steps to reproduce the problem

I created a sample project to illustrate this. It is based on the standard HelloWorld archetype for Azure functions.
It consists of two projects:

  1. library, this must be build and installed in the local maven cache first!
  2. function, Azure function project that uses the library.

The shade plugin is used to combine all dependencies.

Do the following after cloning:

cd library
mvn clean package install
cd ..
cd function
mvn clean package

Resulting error:

C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function>mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Azure Java Functions 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ azfunctions-abstractmethodissue ---
[INFO] Deleting C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ azfunctions-abstractmethodissue ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ azfunctions-abstractmethodissue ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ azfunctions-abstractmethodissue ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ azfunctions-abstractmethodissue ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\target\test-classes
[WARNING] /C:/Users/angor/git/nicenemo/azfunctions-abstractmethodissue/function/src/test/java/eu/hanskruse/FunctionTest.java: C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\src\test\java\eu\hanskruse\FunctionTest.java uses unchecked or unsafe operations.
[WARNING] /C:/Users/angor/git/nicenemo/azfunctions-abstractmethodissue/function/src/test/java/eu/hanskruse/FunctionTest.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ azfunctions-abstractmethodissue ---
[INFO] Surefire report directory: C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running eu.hanskruse.FunctionTest
Jan 02, 2018 1:39:13 PM eu.hanskruse.Function hello
SEVERE: Signature length: 4
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.797 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ azfunctions-abstractmethodissue ---
[INFO] Building jar: C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\target\azfunctions-abstractmethodissue-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-shade-plugin:3.1.0:shade (default) @ azfunctions-abstractmethodissue ---
[INFO] Including com.microsoft.azure:azure-functions-java-core:jar:1.0.0-beta-2 in the shaded jar.
[INFO] Including eu.hanskruse:abstractmethod-library:jar:1.0.0-SNAPSHOT in the shaded jar.
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\target\azfunctions-abstractmethodissue-1.0-SNAPSHOT.jar with C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\target\azfunctions-abstractmethodissue-1.0-SNAPSHOT-shaded.jar
[INFO] Dependency-reduced POM written at: C:\Users\angor\git\nicenemo\azfunctions-abstractmethodissue\function\dependency-reduced-pom.xml
[INFO]
[INFO] --- azure-functions-maven-plugin:0.1.9:package (package-functions) @ azfunctions-abstractmethodissue ---
AI: INFO 02-01-2018 13:39, 1: Configuration file has been successfully found as resource
AI: INFO 02-01-2018 13:39, 1: Configuration file has been successfully found as resource
[INFO]
[INFO] Step 1 of 6: Searching for Azure Function entry points
[INFO] Reflections took 78 ms to scan 1 urls, producing 1 keys and 1 values
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.566 s
[INFO] Finished at: 2018-01-02T13:39:18+01:00
[INFO] Final Memory: 71M/426M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:0.1.9:package (package-functions) on project azfunctions-abstractmethodissue: Execution package-functions of goal com.microsoft.azure:azure-functions-maven-plugin:0.1.9:package failed: A required class was missing while executing com.microsoft.azure:azure-functions-maven-plugin:0.1.9:package: eu/hanskruse/signing/AbstractSigner
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.microsoft.azure:azure-functions-maven-plugin:0.1.9
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-functions-maven-plugin/0.1.9/azure-functions-maven-plugin-0.1.9.jar
[ERROR] urls[1] = file:/C:/Users/angor/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[2] = file:/C:/Users/angor/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0/org.eclipse.sisu.inject-0.3.0.jar
[ERROR] urls[3] = file:/C:/Users/angor/.m2/repository/org/apache/maven/maven-builder-support/3.3.3/maven-builder-support-3.3.3.jar
[ERROR] urls[4] = file:/C:/Users/angor/.m2/repository/org/eclipse/aether/aether-util/1.0.2.v20150114/aether-util-1.0.2.v20150114.jar
[ERROR] urls[5] = file:/C:/Users/angor/.m2/repository/org/sonatype/sisu/sisu-guice/3.2.5/sisu-guice-3.2.5-no_aop.jar
[ERROR] urls[6] = file:/C:/Users/angor/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[7] = file:/C:/Users/angor/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar
[ERROR] urls[8] = file:/C:/Users/angor/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[9] = file:/C:/Users/angor/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[10] = file:/C:/Users/angor/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[11] = file:/C:/Users/angor/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
[ERROR] urls[12] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-maven-plugin-lib/0.1.6/azure-maven-plugin-lib-0.1.6.jar
[ERROR] urls[13] = file:/C:/Users/angor/.m2/repository/org/apache/maven/shared/maven-filtering/3.0.0/maven-filtering-3.0.0.jar
[ERROR] urls[14] = file:/C:/Users/angor/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar
[ERROR] urls[15] = file:/C:/Users/angor/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[16] = file:/C:/Users/angor/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
[ERROR] urls[17] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure/1.2.1/azure-1.2.1.jar
[ERROR] urls[18] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-resources/1.2.1/azure-mgmt-resources-1.2.1.jar
[ERROR] urls[19] = file:/C:/Users/angor/.m2/repository/org/slf4j/slf4j-simple/1.7.5/slf4j-simple-1.7.5.jar
[ERROR] urls[20] = file:/C:/Users/angor/.m2/repository/io/reactivex/rxjava/1.2.4/rxjava-1.2.4.jar
[ERROR] urls[21] = file:/C:/Users/angor/.m2/repository/org/apache/httpcomponents/httpcore/4.4.5/httpcore-4.4.5.jar
[ERROR] urls[22] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-storage/1.2.1/azure-mgmt-storage-1.2.1.jar
[ERROR] urls[23] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-network/1.2.1/azure-mgmt-network-1.2.1.jar
[ERROR] urls[24] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-compute/1.2.1/azure-mgmt-compute-1.2.1.jar
[ERROR] urls[25] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-graph-rbac/1.2.1/azure-mgmt-graph-rbac-1.2.1.jar
[ERROR] urls[26] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-keyvault/1.2.1/azure-mgmt-keyvault-1.2.1.jar
[ERROR] urls[27] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-batch/1.2.1/azure-mgmt-batch-1.2.1.jar
[ERROR] urls[28] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-trafficmanager/1.2.1/azure-mgmt-trafficmanager-1.2.1.jar
[ERROR] urls[29] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-dns/1.2.1/azure-mgmt-dns-1.2.1.jar
[ERROR] urls[30] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-redis/1.2.1/azure-mgmt-redis-1.2.1.jar
[ERROR] urls[31] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-appservice/1.2.1/azure-mgmt-appservice-1.2.1.jar
[ERROR] urls[32] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-cdn/1.2.1/azure-mgmt-cdn-1.2.1.jar
[ERROR] urls[33] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-sql/1.2.1/azure-mgmt-sql-1.2.1.jar
[ERROR] urls[34] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-containerregistry/1.2.1/azure-mgmt-containerregistry-1.2.1.jar
[ERROR] urls[35] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-cosmosdb/1.2.1/azure-mgmt-cosmosdb-1.2.1.jar
[ERROR] urls[36] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-search/1.2.1/azure-mgmt-search-1.2.1.jar
[ERROR] urls[37] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-mgmt-servicebus/1.2.1/azure-mgmt-servicebus-1.2.1.jar
[ERROR] urls[38] = file:/C:/Users/angor/.m2/repository/joda-time/joda-time/2.1/joda-time-2.1.jar
[ERROR] urls[39] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-client-runtime/1.1.0/azure-client-runtime-1.1.0.jar
[ERROR] urls[40] = file:/C:/Users/angor/.m2/repository/com/microsoft/rest/client-runtime/1.1.0/client-runtime-1.1.0.jar
[ERROR] urls[41] = file:/C:/Users/angor/.m2/repository/com/squareup/retrofit2/retrofit/2.1.0/retrofit-2.1.0.jar
[ERROR] urls[42] = file:/C:/Users/angor/.m2/repository/com/squareup/okhttp3/okhttp/3.3.1/okhttp-3.3.1.jar
[ERROR] urls[43] = file:/C:/Users/angor/.m2/repository/com/squareup/okio/okio/1.8.0/okio-1.8.0.jar
[ERROR] urls[44] = file:/C:/Users/angor/.m2/repository/com/squareup/okhttp3/logging-interceptor/3.3.1/logging-interceptor-3.3.1.jar
[ERROR] urls[45] = file:/C:/Users/angor/.m2/repository/com/squareup/okhttp3/okhttp-urlconnection/3.3.1/okhttp-urlconnection-3.3.1.jar
[ERROR] urls[46] = file:/C:/Users/angor/.m2/repository/com/squareup/retrofit2/converter-jackson/2.1.0/converter-jackson-2.1.0.jar
[ERROR] urls[47] = file:/C:/Users/angor/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.7.2/jackson-databind-2.7.2.jar
[ERROR] urls[48] = file:/C:/Users/angor/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-joda/2.7.2/jackson-datatype-joda-2.7.2.jar
[ERROR] urls[49] = file:/C:/Users/angor/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.7.0/jackson-annotations-2.7.0.jar
[ERROR] urls[50] = file:/C:/Users/angor/.m2/repository/com/squareup/retrofit2/adapter-rxjava/2.1.0/adapter-rxjava-2.1.0.jar
[ERROR] urls[51] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-client-authentication/1.1.0/azure-client-authentication-1.1.0.jar
[ERROR] urls[52] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/adal4j/1.1.2/adal4j-1.1.2.jar
[ERROR] urls[53] = file:/C:/Users/angor/.m2/repository/com/nimbusds/oauth2-oidc-sdk/4.5/oauth2-oidc-sdk-4.5.jar
[ERROR] urls[54] = file:/C:/Users/angor/.m2/repository/javax/mail/mail/1.4.7/mail-1.4.7.jar
[ERROR] urls[55] = file:/C:/Users/angor/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
[ERROR] urls[56] = file:/C:/Users/angor/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar
[ERROR] urls[57] = file:/C:/Users/angor/.m2/repository/net/minidev/json-smart/1.1.1/json-smart-1.1.1.jar
[ERROR] urls[58] = file:/C:/Users/angor/.m2/repository/com/nimbusds/lang-tag/1.4/lang-tag-1.4.jar
[ERROR] urls[59] = file:/C:/Users/angor/.m2/repository/com/nimbusds/nimbus-jose-jwt/3.1.2/nimbus-jose-jwt-3.1.2.jar
[ERROR] urls[60] = file:/C:/Users/angor/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.51/bcprov-jdk15on-1.51.jar
[ERROR] urls[61] = file:/C:/Users/angor/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
[ERROR] urls[62] = file:/C:/Users/angor/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar
[ERROR] urls[63] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-annotations/1.2.0/azure-annotations-1.2.0.jar
[ERROR] urls[64] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/applicationinsights-core/1.0.9/applicationinsights-core-1.0.9.jar
[ERROR] urls[65] = file:/C:/Users/angor/.m2/repository/eu/infomas/annotation-detector/3.0.4/annotation-detector-3.0.4.jar
[ERROR] urls[66] = file:/C:/Users/angor/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
[ERROR] urls[67] = file:/C:/Users/angor/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar
[ERROR] urls[68] = file:/C:/Users/angor/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
[ERROR] urls[69] = file:/C:/Users/angor/.m2/repository/commons-net/commons-net/3.6/commons-net-3.6.jar
[ERROR] urls[70] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-functions-java-core/1.0.0-beta-2/azure-functions-java-core-1.0.0-beta-2.jar
[ERROR] urls[71] = file:/C:/Users/angor/.m2/repository/org/reflections/reflections/0.9.11/reflections-0.9.11.jar
[ERROR] urls[72] = file:/C:/Users/angor/.m2/repository/com/google/guava/guava/20.0/guava-20.0.jar
[ERROR] urls[73] = file:/C:/Users/angor/.m2/repository/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar
[ERROR] urls[74] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-storage/5.4.0/azure-storage-5.4.0.jar
[ERROR] urls[75] = file:/C:/Users/angor/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.0/jackson-core-2.6.0.jar
[ERROR] urls[76] = file:/C:/Users/angor/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar
[ERROR] urls[77] = file:/C:/Users/angor/.m2/repository/com/microsoft/azure/azure-keyvault-core/0.8.0/azure-keyvault-core-0.8.0.jar
[ERROR] urls[78] = file:/C:/Users/angor/.m2/repository/org/zeroturnaround/zt-zip/1.12/zt-zip-1.12.jar
[ERROR] urls[79] = file:/C:/Users/angor/.m2/repository/junit/junit/4.12/junit-4.12.jar
[ERROR] urls[80] = file:/C:/Users/angor/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : eu.hanskruse.signing.AbstractSigner
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

Functions plugin not finding existing function app

If you repeatedly deploy ... plugin does not find the existing app

[INFO] Target Function App does not exist. Creating a new Function App ... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:24 min [INFO] Finished at: 2018-01-21T15:48:16-08:00 [INFO] Final Memory: 56M/518M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:0.1.10:deploy (default-cli) on project walkthrough: Website with given name walkthrough-Asir98074 already exists.

Maven deploy plugin sometimes fails to deploy correctly

Plugin name and version

azure-webapp-maven-plugin 0.1.5

Plugin configuration in your pom.xml

                  <plugin>
			<groupId>com.microsoft.azure</groupId>
			<artifactId>azure-webapp-maven-plugin</artifactId>
			<version>0.1.5</version>
			<configuration>
				<authentication>
					<serverId>azure-auth</serverId>
				</authentication>
				<resourceGroup>eotregression</resourceGroup>
				<appName>eotregressionsite</appName>
				<!-- <region> and <pricingTier> are optional. They will be used to create new Web App if the specified Web App doesn't exist -->
				<region>West-Europe</region>
				<pricingTier>S3</pricingTier>

				<!-- Java Runtime Stack-->
				<javaVersion>1.8</javaVersion>
				<javaWebContainer>tomcat 8.5</javaWebContainer>
				<stopAppDuringDeployment>true</stopAppDuringDeployment>

				<!-- FTP deployment -->
				<deploymentType>ftp</deploymentType>
				<!-- Resources to be deployed to your Web App -->
				<resources>
					<resource>
						<!-- Where your artifacts are stored -->
						<directory>${project.basedir}</directory>
						<!-- Relative path to /site/wwwroot/ -->
						<targetPath>webapps</targetPath>
						<includes>
							<include>eot.war</include>
						</includes>
					</resource>
				</resources>
			</configuration>
		</plugin>

Expected behavior

Deployment succeeds always

Actual behavior

In some cases (<- yeah I know, great!) Tomcat cleans the /eot/ exploded folder for everything but a META-INF folder with a manifest file. It then does not unpack the uploaded war into this folder, somehow it thinks that it has already done this. No logging is provided that is at all useful.

Steps to reproduce the problem

A required class was missing while executing azure-functions-maven-plugin:0.2.0:package: DocumentDBInput

Plugin name and version

azure-functions-maven-plugin:0.2.0

Expected behavior

mvn clean package should succeed.

Actual behavior

Report "A required class was missing" error.

Detailed Logs

[ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:0.2.0:package (package-functions) on project survey-report-apis: Execution package-functions of goal com.microsoft.azure:azure-functions-maven-plugin:0.2.0:package failed: A required class was missing while executing com.microsoft.azure:azure-functions-maven-plugin:0.2.0:package: com/microsoft/azure/serverless/functions/annotation/DocumentDBInput
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.microsoft.azure:azure-functions-maven-plugin:0.2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-functions-maven-plugin/0.2.0/azure-functions-maven-plugin-0.2.0.jar
[ERROR] urls[1] = file:/Users/ankit.choudhary/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[2] = file:/Users/ankit.choudhary/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0/org.eclipse.sisu.inject-0.3.0.jar
[ERROR] urls[3] = file:/Users/ankit.choudhary/.m2/repository/org/apache/maven/maven-builder-support/3.3.3/maven-builder-support-3.3.3.jar
[ERROR] urls[4] = file:/Users/ankit.choudhary/.m2/repository/org/eclipse/aether/aether-util/1.0.2.v20150114/aether-util-1.0.2.v20150114.jar
[ERROR] urls[5] = file:/Users/ankit.choudhary/.m2/repository/org/sonatype/sisu/sisu-guice/3.2.5/sisu-guice-3.2.5-no_aop.jar
[ERROR] urls[6] = file:/Users/ankit.choudhary/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[7] = file:/Users/ankit.choudhary/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar
[ERROR] urls[8] = file:/Users/ankit.choudhary/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[9] = file:/Users/ankit.choudhary/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[10] = file:/Users/ankit.choudhary/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[11] = file:/Users/ankit.choudhary/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
[ERROR] urls[12] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-maven-plugin-lib/0.2.0/azure-maven-plugin-lib-0.2.0.jar
[ERROR] urls[13] = file:/Users/ankit.choudhary/.m2/repository/org/apache/maven/shared/maven-filtering/3.0.0/maven-filtering-3.0.0.jar
[ERROR] urls[14] = file:/Users/ankit.choudhary/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar
[ERROR] urls[15] = file:/Users/ankit.choudhary/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[16] = file:/Users/ankit.choudhary/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
[ERROR] urls[17] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure/1.7.0/azure-1.7.0.jar
[ERROR] urls[18] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-resources/1.7.0/azure-mgmt-resources-1.7.0.jar
[ERROR] urls[19] = file:/Users/ankit.choudhary/.m2/repository/org/slf4j/slf4j-simple/1.7.5/slf4j-simple-1.7.5.jar
[ERROR] urls[20] = file:/Users/ankit.choudhary/.m2/repository/io/reactivex/rxjava/1.2.4/rxjava-1.2.4.jar
[ERROR] urls[21] = file:/Users/ankit.choudhary/.m2/repository/org/apache/httpcomponents/httpcore/4.4.5/httpcore-4.4.5.jar
[ERROR] urls[22] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-storage/1.7.0/azure-mgmt-storage-1.7.0.jar
[ERROR] urls[23] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-network/1.7.0/azure-mgmt-network-1.7.0.jar
[ERROR] urls[24] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-compute/1.7.0/azure-mgmt-compute-1.7.0.jar
[ERROR] urls[25] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-graph-rbac/1.7.0/azure-mgmt-graph-rbac-1.7.0.jar
[ERROR] urls[26] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-keyvault/1.7.0/azure-mgmt-keyvault-1.7.0.jar
[ERROR] urls[27] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-keyvault/1.0.0/azure-keyvault-1.0.0.jar
[ERROR] urls[28] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-keyvault-webkey/1.0.0/azure-keyvault-webkey-1.0.0.jar
[ERROR] urls[29] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-batch/1.7.0/azure-mgmt-batch-1.7.0.jar
[ERROR] urls[30] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-trafficmanager/1.7.0/azure-mgmt-trafficmanager-1.7.0.jar
[ERROR] urls[31] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-dns/1.7.0/azure-mgmt-dns-1.7.0.jar
[ERROR] urls[32] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-redis/1.7.0/azure-mgmt-redis-1.7.0.jar
[ERROR] urls[33] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-appservice/1.7.0/azure-mgmt-appservice-1.7.0.jar
[ERROR] urls[34] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-locks/1.7.0/azure-mgmt-locks-1.7.0.jar
[ERROR] urls[35] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-eventhub/1.7.0/azure-mgmt-eventhub-1.7.0.jar
[ERROR] urls[36] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-cdn/1.7.0/azure-mgmt-cdn-1.7.0.jar
[ERROR] urls[37] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-sql/1.7.0/azure-mgmt-sql-1.7.0.jar
[ERROR] urls[38] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-containerinstance/1.7.0/azure-mgmt-containerinstance-1.7.0.jar
[ERROR] urls[39] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-containerregistry/1.7.0/azure-mgmt-containerregistry-1.7.0.jar
[ERROR] urls[40] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-containerservice/1.7.0/azure-mgmt-containerservice-1.7.0.jar
[ERROR] urls[41] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-cosmosdb/1.7.0/azure-mgmt-cosmosdb-1.7.0.jar
[ERROR] urls[42] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-search/1.7.0/azure-mgmt-search-1.7.0.jar
[ERROR] urls[43] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-msi/1.7.0/azure-mgmt-msi-1.7.0.jar
[ERROR] urls[44] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-monitor/1.7.0/azure-mgmt-monitor-1.7.0.jar
[ERROR] urls[45] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-servicebus/1.7.0/azure-mgmt-servicebus-1.7.0.jar
[ERROR] urls[46] = file:/Users/ankit.choudhary/.m2/repository/joda-time/joda-time/2.1/joda-time-2.1.jar
[ERROR] urls[47] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-mgmt-batchai/1.7.0/azure-mgmt-batchai-1.7.0.jar
[ERROR] urls[48] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-client-runtime/1.3.0/azure-client-runtime-1.3.0.jar
[ERROR] urls[49] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/rest/client-runtime/1.3.0/client-runtime-1.3.0.jar
[ERROR] urls[50] = file:/Users/ankit.choudhary/.m2/repository/com/squareup/retrofit2/retrofit/2.1.0/retrofit-2.1.0.jar
[ERROR] urls[51] = file:/Users/ankit.choudhary/.m2/repository/com/squareup/okhttp3/okhttp/3.4.2/okhttp-3.4.2.jar
[ERROR] urls[52] = file:/Users/ankit.choudhary/.m2/repository/com/squareup/okio/okio/1.9.0/okio-1.9.0.jar
[ERROR] urls[53] = file:/Users/ankit.choudhary/.m2/repository/com/squareup/okhttp3/logging-interceptor/3.4.2/logging-interceptor-3.4.2.jar
[ERROR] urls[54] = file:/Users/ankit.choudhary/.m2/repository/com/squareup/okhttp3/okhttp-urlconnection/3.4.2/okhttp-urlconnection-3.4.2.jar
[ERROR] urls[55] = file:/Users/ankit.choudhary/.m2/repository/com/squareup/retrofit2/converter-jackson/2.1.0/converter-jackson-2.1.0.jar
[ERROR] urls[56] = file:/Users/ankit.choudhary/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.7.2/jackson-databind-2.7.2.jar
[ERROR] urls[57] = file:/Users/ankit.choudhary/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-joda/2.7.2/jackson-datatype-joda-2.7.2.jar
[ERROR] urls[58] = file:/Users/ankit.choudhary/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.7.0/jackson-annotations-2.7.0.jar
[ERROR] urls[59] = file:/Users/ankit.choudhary/.m2/repository/com/squareup/retrofit2/adapter-rxjava/2.1.0/adapter-rxjava-2.1.0.jar
[ERROR] urls[60] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-client-authentication/1.3.0/azure-client-authentication-1.3.0.jar
[ERROR] urls[61] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/adal4j/1.1.2/adal4j-1.1.2.jar
[ERROR] urls[62] = file:/Users/ankit.choudhary/.m2/repository/com/nimbusds/oauth2-oidc-sdk/4.5/oauth2-oidc-sdk-4.5.jar
[ERROR] urls[63] = file:/Users/ankit.choudhary/.m2/repository/javax/mail/mail/1.4.7/mail-1.4.7.jar
[ERROR] urls[64] = file:/Users/ankit.choudhary/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
[ERROR] urls[65] = file:/Users/ankit.choudhary/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar
[ERROR] urls[66] = file:/Users/ankit.choudhary/.m2/repository/net/minidev/json-smart/1.1.1/json-smart-1.1.1.jar
[ERROR] urls[67] = file:/Users/ankit.choudhary/.m2/repository/com/nimbusds/lang-tag/1.4/lang-tag-1.4.jar
[ERROR] urls[68] = file:/Users/ankit.choudhary/.m2/repository/com/nimbusds/nimbus-jose-jwt/3.1.2/nimbus-jose-jwt-3.1.2.jar
[ERROR] urls[69] = file:/Users/ankit.choudhary/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.51/bcprov-jdk15on-1.51.jar
[ERROR] urls[70] = file:/Users/ankit.choudhary/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
[ERROR] urls[71] = file:/Users/ankit.choudhary/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar
[ERROR] urls[72] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-annotations/1.2.0/azure-annotations-1.2.0.jar
[ERROR] urls[73] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/applicationinsights-core/1.0.9/applicationinsights-core-1.0.9.jar
[ERROR] urls[74] = file:/Users/ankit.choudhary/.m2/repository/eu/infomas/annotation-detector/3.0.4/annotation-detector-3.0.4.jar
[ERROR] urls[75] = file:/Users/ankit.choudhary/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
[ERROR] urls[76] = file:/Users/ankit.choudhary/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar
[ERROR] urls[77] = file:/Users/ankit.choudhary/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
[ERROR] urls[78] = file:/Users/ankit.choudhary/.m2/repository/commons-net/commons-net/3.6/commons-net-3.6.jar
[ERROR] urls[79] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-functions-java-core/1.0.0-beta-3/azure-functions-java-core-1.0.0-beta-3.jar
[ERROR] urls[80] = file:/Users/ankit.choudhary/.m2/repository/org/reflections/reflections/0.9.11/reflections-0.9.11.jar
[ERROR] urls[81] = file:/Users/ankit.choudhary/.m2/repository/com/google/guava/guava/20.0/guava-20.0.jar
[ERROR] urls[82] = file:/Users/ankit.choudhary/.m2/repository/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar
[ERROR] urls[83] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-storage/5.4.0/azure-storage-5.4.0.jar
[ERROR] urls[84] = file:/Users/ankit.choudhary/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.0/jackson-core-2.6.0.jar
[ERROR] urls[85] = file:/Users/ankit.choudhary/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar
[ERROR] urls[86] = file:/Users/ankit.choudhary/.m2/repository/com/microsoft/azure/azure-keyvault-core/0.8.0/azure-keyvault-core-0.8.0.jar
[ERROR] urls[87] = file:/Users/ankit.choudhary/.m2/repository/org/zeroturnaround/zt-zip/1.12/zt-zip-1.12.jar
[ERROR] urls[88] = file:/Users/ankit.choudhary/.m2/repository/junit/junit/4.12/junit-4.12.jar
[ERROR] urls[89] = file:/Users/ankit.choudhary/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] : com.microsoft.azure.serverless.functions.annotation.DocumentDBInput
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

Wrong error message for web app(Windows)

Plugin name and version

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>0.2.0-SNAPSHOT</version>

Repro steps

Create a web app(Windows) using an existing Linux plan

Actual behavior

image

Cryptic Maven null pointer error when deploying function with configured Azure principal

Plugin name and version

I'm using the azure-functions-maven-plugin , version 0.1.9-SNAPSHOT (cloned from github).

Plugin configuration in your pom.xml

The main "non-standard" section is the authentication tag for picking up Azure principal credentials from Maven settings (settings.xml).

<plugin>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-functions-maven-plugin</artifactId>
  <configuration>
   <authentication>
     <serverId>azure-auth</serverId>
    </authentication>
    <resourceGroup>MY_CONFIGURED_RESOURCE_GROUP_IN_AZURE</resourceGroup>
    <appName>${functionAppName}</appName>
    <region>${functionAppRegion}</region>
    <appSettings>
      <property>
        <name>FUNCTIONS_EXTENSION_VERSION</name>
        <value>beta</value>
      </property>
    </appSettings>
  </configuration>
  <executions>
    <execution>
      <id>package-functions</id>
      <goals>
        <goal>package</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Expected behavior

  1. In a previously working Azure function project (deployed with Maven), switch from Azure CLI login (az login) to a configured Azure principal (https://docs.microsoft.com/en-us/java/azure/spring-framework/deploy-spring-boot-java-app-with-maven-plugin#configure-maven-to-use-your-azure-service-principal).
  2. The deployment of the java function should be successful after required changes(pom.xml and user settings.xml changes). This should behave the same as after using the Azure CLI tools (az login followed by mvn azure-functions:deploy)

Actual behavior

The deployment fails using mvn azure-functions:deploy, with a cryptic null pointer exception

screenshot from 2017-12-28 11-04-17

Steps to reproduce the problem

  1. Create a simple java function Maven project by following the official tutorial: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven
  2. Create a service principal per official tutorial, for Maven usage
    https://docs.microsoft.com/en-us/java/azure/spring-framework/deploy-spring-boot-java-app-with-maven-plugin#configure-maven-to-use-your-azure-service-principal
  3. Notice that there's a cryptic null pointer exception (same exception as per first comment for the article at https://docs.microsoft.com/en-us/java/azure/spring-framework/deploy-spring-boot-java-app-with-maven-plugin)

Allow for specification of resource group name during setup and in pom.xml

There should be tooling support when using Maven to create a new function to specify the resource group name. This could be asked as part of the archetype setup process, and offer a default of the existing 'java-functions-group'. I note that there is already support for specifying the resource group in the generated pom.xml file, so extending this to ask during the archetype setup should hopefully not be too burdensome.

I ask because when I create a few test projects I quickly end up with a mess of services all in the ‘java-functions-group’, and it makes it very hard to tell which resources belong to which function.

Object reference not set to an instance of an object

Plugin name and version

com.microsoft.azure.azure-functions-maven-plugin:0.1.10-SNAPSHOT

Steps to reproduce the problem

  1. Generate a scaffolding through the Azure Functions Maven Archetype
    mvn archetype:generate -DarchetypeGroupId=com.microsoft.azure -DarchetypeArtifactId=azure-functions-archetype
  2. mvn package azure-functions:package
  3. mvn azure-functions:run
  4. Ctrl-C to exist
  5. Run mvn azure-functions:run again

image

setting the name of the function app on the command line does not work

Plugin name and version

Plugin configuration in your pom.xml

 <plugin>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-functions-maven-plugin</artifactId>
        <version>0.1.10</version>
        <executions>
          <execution>
            <id>package-functions</id>
            <goals>
              <goal>package</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <resourceGroup>Developers_group</resourceGroup>
          <appName>${functionAppName}</appName>
          <region>westeurope</region>
          <appSettings>
            <property>
              <name>FUNCTIONS_EXTENSION_VERSION</name>
              <value>beta</value>
            </property>
          </appSettings>
        </configuration>
      </plugin>

Expected behavior

using
mvn clean package -DfunctionAppName=banana should work

Actual behavior

INFO] --- maven-assembly-plugin:2.2-beta-5:single (package-signpdf) @  my-app  ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.399 s
[INFO] Finished at: 2018-02-08T10:52:52+01:00
[INFO] Final Memory: 84M/579M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (package-myapp) on project di-signpdf: Failed to create assembly: Error creating assembly archive null: You must set at least one file. -> [Help 1]
...

Note that setting a variable for something else is not a problem.
We use the assemble plugin to create zip files. changing a variable to change the filename of the produced zip is not a problem.

Steps to reproduce the problem

Use the functionAppName also for the resource plugin

mvn clean package -DfunctionAppName=banana

App Service v0.2.0 endgame

Documentation

  • 3/9 - readme.md
  • 3/9 - request a new tutorial on Docs

Test

  • Bug bash
  • Test according to test plan @bsaby

Release

  • Add tag
  • Publish to Maven Central

java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext when building a function which calls Spring's Application Context

Plugin name and version

com.microsoft.azure.azure-functions-maven-plugin:0.1.10

Plugin configuration in your pom.xml

		<plugin>
			<groupId>com.microsoft.azure</groupId>
			<artifactId>azure-functions-maven-plugin</artifactId>
			<configuration>
				<resourceGroup>java-functions-group</resourceGroup>
				<appName>${functionAppName}</appName>
				<region>${functionAppRegion}</region>
				<appSettings>
					<property>
						<name>FUNCTIONS_EXTENSION_VERSION</name>
						<value>beta</value>
					</property>
				</appSettings>
			</configuration>
			<executions>
				<execution>
					<id>package-functions</id>
					<goals>
						<goal>package</goal>
					</goals>
				</execution>
			</executions>
		</plugin>

Expected behavior

Generate my maven package

Actual behavior

I'm getting the error bellow only when my code is using applicationContext.getBean() method. If I use ApplicationContext class, it works.

So it works with this:

ApplicationContext appContext = new ClassPathXmlApplicationContext("classpath*:/application-context.xml");

If I add the following line, it stops working:

appContext.getBean("jdbcTemplate");

And the mvn clean package throws the following error:
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]


    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:166)
    ... 21 more

Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethod(Class.java:2128)
at org.reflections.util.Utils.getMemberFromDescriptor(Utils.java:88)
at org.reflections.util.Utils.getMethodsFromDescriptors(Utils.java:101)
at org.reflections.Reflections.getMethodsAnnotatedWith(Reflections.java:482)
at com.microsoft.azure.maven.function.handlers.AnnotationHandlerImpl.findFunctions(AnnotationHandlerImpl.java:43)
at com.microsoft.azure.maven.function.PackageMojo.findAnnotatedMethods(PackageMojo.java:97)
at com.microsoft.azure.maven.function.PackageMojo.doExecute(PackageMojo.java:62)
at com.microsoft.azure.maven.AbstractAzureMojo.execute(AbstractAzureMojo.java:288)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 32 more

Steps to reproduce the problem

Redeploy on App Service Windows throws error

Here is the redeploy error:

ERROR] Failed to upload directory: /Users/selvasingh/GitHub/demo/gs-spring-boot/complete/target/azure-webapps/maven-web-app-99758 --> /site/wwwroot

Packaging fails with multi module project

Plugin name and version

   <pluginManagement>
            <plugins>
   ...
                <plugin>
                    <groupId>com.microsoft.azure</groupId>
                    <artifactId>azure-functions-maven-plugin</artifactId>
                    <version>0.1.6</version>
                </plugin>
            </plugins>
        </pluginManagement>

Plugin configuration in your pom.xml

...
    <build>
...
        <plugins>
            <plugin>
                <groupId>com.microsoft.azure</groupId>
                <artifactId>azure-functions-maven-plugin</artifactId>
                <configuration>
                    <resourceGroup>java-functions-group</resourceGroup>
                    <appName>${functionAppName}</appName>
                    <region>${functionAppRegion}</region>
                    <appSettings>
                        <property>
                            <name>FUNCTIONS_EXTENSION_VERSION</name>
                            <value>beta</value>
                        </property>
                    </appSettings>
                </configuration>
                <executions>
                    <execution>
                        <id>package-functions</id>
                        <goals>
                            <goal>package</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            ...

Expected behavior

As a developer in a project using Azure Functions I want to use the Java Azure SDK with components from private repositories.

  • mvn package works.

  • mvn azure-functions:run works.

  • I want to use a self created library from my Azure Function

  • I want to use proprietary libraries within that function or another function. These libraries cannot be deployed to Maven Central or another public repository for legal reasons.

Actual behavior

Both fail with a complaint of missing a class from a jar in a private repo.

Steps to reproduce the problem

In an Azure Functions project mvn package fails if you refer components in private repositories.

Normal package works

If you remove azure-functions-maven-plugin plugin from the pom.xml a normal package works. So it is for sure something in the azure-functions-maven-plugin

Reproduce

  1. Create an Azure Function with the Azure Functions Archetype:
    https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven
  2. create another java project that just produces a jar with an Hello World function.
  3. install the jar in your local .m2 cache
  4. Refer to it from the Function project pom file.
  5. Use the Hello World from within the function
  6. mvn compile and mvn test should already work
  7. observe that mvn package does not work.

Private repo

After Googleing I noticed that for package a repository should be available and that packaging does not work with only the local cache in ~/.m2

I "Fixed" this by publishing to a local repository from the library project and refering to that from the Azure Function project.
8. Publish to "remote" repository by adding the following to the pom.xml of the library project:

<plugin>
  <artifactId>maven-deploy-plugin</artifactId>
  <version>2.8.2</version>
  <configuration>
  
 <altDeploymentRepository>internal.repo::default::file:${project.basedir}/../mvn-repo</altDeploymentRepository>
  </configuration>
</plugin>
  1. Do mvn clean package install deploy in the library project folder.
  2. Verify that the library is deployed to the new local file repo.
  3. clear my .m2/repository
  4. Go to the functions project project
  5. Add the following to the pom.xml file
<repositories>
    <!--other repositories if any-->
    <repository>
        <id>project.local</id>
        <name>project</name>
        <url>file:${project.basedir}/../mvn-repo</url>
    </repository>
</repositories>
  1. do mvn clean compile test
  2. Observe that the tests are run (If you do not add the repository. The code will fail to compile/test if your .m2 cache is empty too.)
  3. Do mvn package --> fails with library classes that cannot be found
  4. Try mvn azure-functions:run It tries to package first and fails.

Error:

INFO] Reflections took 78 ms to scan 1 urls, producing 1 keys and 1 values
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.051 s
[INFO] Finished at: 2017-11-09T15:41:27+01:00
[INFO] Final Memory: 43M/286M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:0.1.6:package (package-functions) on project helloworldFunction: Execution package-functions of goal com.microsoft.azure:azure-functions-mave
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.microsoft.azure:azure-functions-maven-plugin:0.1.6
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/hkruse/.m2/repository/com/microsoft/azure/azure-functions-maven-plugin/0.1.6/azure-functions-maven-plugin-0.1.6.jar
[... <<<cut>>> ...]
[ERROR] urls[82] = file:/C:/Users/hkruse/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

Side note: using Github as repo

We looked into using hosted Nexus as a repo but did not do that for cost reasons.

We finally want to use either Github site plugin or Wagon-git
I think wagon-git is finally the way to go because the site plugin is more for publishing sites.
I did not want to complicate matters more yet by using git based repo plugins now. So I used the local file system to try it out.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.