Flag | Description | Example |
---|---|---|
| Language to use for the function (one of |
|
| Test framework to use for the function (one of , |
|
|
| |
| Features to use for the function, comma-separated | or |
| Provider to use for the function (currently the only supported provider is |
|
If present, generates the function in the current directory (function name is optional if this flag is set) |
|
Setting the language using the lang
flag will generate a *Function
file in the appropriate language. For Java/Kotlin, this will generate a class annotated with . For Groovy, a Groovy function script will be generated. See Writing Functions for more details on how to write and test Micronaut functions.
Depending on language choice, an appropriate test will also be generated. By default, a Java function will include a JUnit test, a Groovy function will include a Spock test, and a Kotlin function will include a KotlinTest test. However, you can override the chosen test framework with the test
flag.
Build Tool
Depending upon the build tool selected, the project will include various tasks for building/deploying the function.
Gradle
Functions with a Gradle build are preconfigured with the . The configuration can be seen in the build.gradle
file (see the section on Deploying Functions to AWS Lambda). Assuming valid AWS credentials under ~/.aws/credentials
, the application can be deployed using the deploy
task.
Maven
Functions with a Maven build are preconfigured with the Maven Shade Plugin, which will generate an executable JAR suitable for uploading to AWS Lambda. The JAR file can be built using the package
phase.