- Notifications
You must be signed in to change notification settings - Fork66
Java runtime and core types for Microsoft Azure Functions
License
Azure/azure-functions-java-worker
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
| Branch | Status |
|---|---|
| Dev | |
| v3 |
Please refer toCONTRIBUTING.md for more information.
- Run all maven commands under the root folder of this repository
- Import the root folder of this repository as an existing project in IntelliJ
- Configure the Language level (under Project Structure -> Modules -> Sources) to 8
- Set workspace to the parent folder of this repository
- Import the root folder of this repository as an existing Maven project in Eclipse
- Configure the project Java compiler compliance level to 1.8
- Set the JRE libraries to JRE 1.8
- "Ignore optional compiler problems" in "Java Build Path" for "target/generated-sources/**/*.java"
This is a maven based project, thus you can use any command line tools or IDEs which support maven to build it. Here we will use command line as the example (you could configure your own development environment accordingly).
To build the project, you just need to run one command from the root folder of this project:
mvn clean package
And the binary will be built to"./azure-functions-java-worker/target/azure-functions-java-worker-<version>.jar".
If you have updated the core interface (azure-functions-java-core), amvn clean install is required for your test functions app to reference the latest core package.
- Update dependencies
mvn versions:use-latest-versions- Update plugins
mvn versions:display-plugin-updatesFor each of the plugin that displayed, update pom.xml
- Update version
mvn release:update-versionsThe Java worker alone is not enough to establish the functions app, we also need the support fromAzure Functions Host. You may either use a published host CLI or use the in-development host. But both of the methods require you to attach to the java process if you want a step-by-step debugging experience.
You can install the latest Azure functions CLI tool by:
npm install -g azure-functions-core-tools@core
By default, the binaries are located in"<Home Folder>/.azurefunctions/bin". Copy the"<Azure Functions Java Worker Root>/azure-functions-java-worker/target/azure-functions-java-worker-<version>.jar" to"<Home Folder>/.azurefunctions/bin/workers/java/azure-functions-java-worker.jar". And start it normally using:
func start
A developer may also use the latest host code by cloning the git repositoryAzure Functions Host. Now you need to navigate to the root folder of the host project and build it through:
dotnet restore WebJobs.Script.slndotnet build WebJobs.Script.sln
After the build succeeded, set the environment variable"AzureWebJobsScriptRoot" to the root folder path (the folder which contains thehost.json) of your test functions app; and copy the"<Azure Functions Java Worker Root>/azure-functions-java-worker/target/azure-functions-java-worker-<version>.jar" to"<Azure Functions Host Root>/src/WebJobs.Script.WebHost/bin/Debug/netcoreapp2.0/workers/java/azure-functions-java-worker.jar". Now it's time to start the host:
dotnet ./src/WebJobs.Script.WebHost/bin/Debug/netcoreapp2.0/Microsoft.Azure.WebJobs.Script.WebHost.dll
Note: Remember to remove
"AzureWebJobsScriptRoot"environment variable after you have finished debugging, because it will also influence thefuncCLI tool.
Simply using the following command to do so (if there are dependency errors, runmvn clean install beforehand):
mvn javadoc:javadoc
Java worker now shades all its jars, to introduce any new jars it is required by the developers to add a section in the pom file to relocate it.
Our version strategy just follows the maven package version convention:<major>.<minor>.<hotfix>-<prerelease>, where:
<major>: Increasing when incompatible breaking changes happened<minor>: Increasing when new features added<hotfix>: Increasing when a hotfix is pushed<prerelease>: A string representing a pre-release version
UseSNAPSHOT pre-release tag for packages under development. Here is the sample workflow:
- Initially the package version is
1.0-SNAPSHOT.There is no hotfix for SNAPSHOT - Modify the version to
1.0.0-ALPHAfor internal testing purpose.Notice the hotfix exists here - After several BUG fixes, update the version to
1.0.0. - Create a new development version
1.1-SNAPSHOT. - Make a new hotfix into
1.0-SNAPSHOT, and release to version1.0.1. - New features are added to
1.1-SNAPSHOT.
Every time you release a non-development version (like1.0.0-ALPHA or1.0.1), you also need to update the tag in your git repository.
Primitives have two different type definitions, for example:int.class (which is identical toInteger.TYPE) is notInteger.class.
All Java types are represented byType interface, which may be one of the following implementations:
Class<?>: normal class type likeStringParameterizedType: generic class type likeList<Integer>WildcardType: generic argument contains question mark like? extends NumberTypeVariable<?>: generic argument likeTGenericArrayType: generic array likeT[]
For the generic type behaviors (including compile-time validation and runtime type erasure) in Java, please refer toGenerics in the Java Programming Language.
About
Java runtime and core types for Microsoft Azure Functions
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
