microsoft / azure-maven-plugins Goto Github PK
View Code? Open in Web Editor NEWMaven plugins for Azure
License: MIT License
Maven plugins for Azure
License: MIT License
pom.xml
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.
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
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.
This can be fixed by upgrading the AI runtime to 2.0.2
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.
com.microsoft.azure:azure-functions-maven-plugin:0.1.10
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>
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.
I'm using the azure-functions-maven-plugin , version 0.1.9-SNAPSHOT (cloned from github).
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>
The deployment fails using mvn azure-functions:deploy, with a cryptic null pointer exception
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.
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
azure-functions-maven-plugin v0.2.0
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>
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
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
mvn archetype:generate -DarchetypeGroupId=com.microsoft.azure -DarchetypeArtifactId=azure-functions-archetype -DarchetypeVersion=1.8
mvn azure-functions:package
& mvn azure-functions:run
<pluginManagement>
<plugins>
...
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>0.1.6</version>
</plugin>
</plugins>
</pluginManagement>
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>
...
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.
Both fail with a complaint of missing a class from a jar in a private repo.
In an Azure Functions project mvn package
fails if you refer components in private repositories.
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
Hello World
function.Hello World
from within the functionmvn compile
and mvn test
should already workmvn package
does not work.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>
mvn clean package install deploy
in the library project folder.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>
mvn clean compile test
mvn package
--> fails with library classes that cannot be foundmvn 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]]
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.
azure-webapp-maven-plugin 0.1.5
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>
Deployment succeeds always
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.
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.
Should provide a full link to the Web app
###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.
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>
Only one jar is deployed.
The original jar is not removed.
mvn clean package
output folder still contains two jars
In order to use the Microsoft.Azure.WebJobs.Extensions.CosmosDB
Input or Output bindings, or trigger, I use the DocumentDb
attribute. Should be named CosmosDb
azure-functions-maven-plugin
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>
Build Succeeded.
Build Failed.
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
com.microsoft.azure.azure-functions-maven-plugin:0.1.10-SNAPSHOT
We have this bug in .NET as well, but in v2 the property path
is renamed eventHubName
. Need to rename it here as well so that the function.json has eventHubName
property.
Mitigation today is you have to manually modify the generated function.json post-package
update the Autorest Client Runtime for Java to 1.3.1 will fix this issue.
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>
using
mvn clean package -DfunctionAppName=banana
should work
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.
Use the functionAppName also for the resource plugin
mvn clean package -DfunctionAppName=banana
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.
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.
Repeat the problem:
Maven Plugin for Azure Functions
pom.xml
pom.txt(the default maven create)
when running the function,and excute the command "curl http://localhost:7071/api/hello?req=world", it should return "Hello, world"
get the 400 response
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);
}
}`
there is a confuse: why the parameter key is named "name" in code rather than“req”
String name = request.getQueryParameters().get("name");"
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>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>0.1.9</version>
</plugin>
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>
The azure functions plugin should be able to package code that uses abstract classes and methods.
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.
I created a sample project to illustrate this. It is based on the standard HelloWorld archetype for Azure functions.
It consists of two projects:
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
Reference: Azure/azure-sdk-for-java#1755
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>0.1.9</version>
</plugin>
<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>
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.
Packaging is probably not correct.
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:
mvn clean package install
on the multi module project.mvn clean package azure-functions:package azure-functions:run
on the function projectThis workaround requires extra steps on the build environment instead of a one liner in Maven.
azure-functions-maven-plugin (0.2.0)
pom.xml
Project should be packaged with all dependancies.
Error as mentioned.
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
com.microsoft.azure.azure-functions-maven-plugin:0.1.10-SNAPSHOT
According to the doc: https://github.com/Microsoft/azure-maven-plugins/blob/master/azure-functions-maven-plugin/README.md#run-a-single-azure-function
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
https://github.com/Microsoft/gs-spring-boot-docker/blob/private-registry/complete/pom.xml - line 21
To run this sample project, users must change the registry name in line 21. Please modify this to a environment variable. So, users can use without changing POM and do not accidentally check POM changes into their forked version of this sample
azure-webapp-maven-plugin 1.1.0
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>
should be read git version as abbrev
[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"}}
Use git.commit.id.abbrev in pom
Details can be found in Azure/azure-functions-java-worker#43
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.
Azure Maven Plugin for Web Apps 0.1.5
pom.xml
Any configuration
Should allow the use of existing app service plans
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.
Just keep running one of the sample deployments to Azure Web Apps
Particularly: tomcat 8.5
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
).
azure-functions-maven-plugin:0.1.10
pom.xml
Attached.
Behaviour of mvn package
does not change when project source is modified
Build failure log attached.
mvn -e package
, observe the error.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")
).mvn package
again, observe build success.azure-functions-maven-plugin:0.2.0
mvn clean package
should succeed.
Report "A required class was missing" error.
[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
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
Should we use a simple algorithm for naming these plugins:
Maven plugin for [AZURE-SERVICE-NAME]
Say
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:
azure-webapp-maven-plugin 1.0.3
pom.xml
FTP -> azure webapp
Undeploy the existing ROOT dir on server
Deploy WAR file
Be happy
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
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
com.microsoft.azure.azure-functions-maven-plugin:0.1.10
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>
Generate my maven package
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.