Payara Micro Gradle Plugin
Payara Micro has a Gradle plugin which can start and stop Payara Micro and create an Uber JAR bundle of the application and Payara Micro .
The plugin requires JDK 8 or higher and the latest plugin version is currently 1.1.0
|
Installation
To use it, simply add the following script to your build.gradle
:
plugins {
id "fish.payara.micro-gradle-plugin" version "1.1.0"
}
Configuration Example
payaraMicro {
payaraVersion = '6.2022.1.alpha3'
deployWar = false
useUberJar = true
daemon = false
commandLineOptions = [port: 2468]
javaCommandLineOptions = [Dtest: 'test123', ea:true]
}
Plugin Tasks
microBundle
Aim: This task bundles the attached project’s artifact into an Uber JAR with the specified configurations.
Usage: gradle microBundle
Element | Default | Notes |
---|---|---|
|
java |
Absolute path to the java executable |
|
6.2022.1.alpha3 |
By default |
microStart
Aim: This task starts Payara Micro with the specified configuration.
Usage: gradle microStart
Element | Default | Notes |
---|---|---|
|
false |
Use created uber-jar that resides in target folder. The name of the JAR artifact will be resolved automatically by evaluating its final name, artifact ID and version. This configuration element has the higher precedence compared to |
|
none |
Absolute path to payara-micro executable. |
|
6.2022.1.alpha3 |
By default |
|
false |
Starts Payara Micro in separate JVM process and continues with the Gradle build. |
|
false |
If Payara Micro is executed in daemon mode, the executor thread will wait for the ready message before shutting down its process. By setting |
|
|
Absolute path to the java executable. |
|
false |
If the attached project is of type WAR, it will automatically be deployed to Payara Micro if |
|
none |
Defines a list of command line options that will be passed to |
|
none |
Defines a list of command line options that will be passed onto Payara Micro. |
|
false |
Enables the hot reload mode. |
microStop
Aim: This task stops Payara Micro with the specified configuration. By default this task tries to find out currently executing Payara Micro instance based on project GAV. If processId
is defined, it will take precedence and the given processId
will immediately kill the executing Payara Micro instance.
Usage: gradle microStop
Element | Default | Notes |
---|---|---|
|
none |
Process id of the running Payara Micro instance. |
|
false |
Use created uber-jar that resides in build\libs folder. The name of the jar artifact will be resolved automatically by evaluating its final name. |
microReload
Aim: This task reloads the Payara Micro application with the specified configuration. By default, this task performs the vanilla deployment of the application without restarting the Payara Micro instance. If hotDeploy
is set to true then the Hot Reload functionality will be enabled.
Usage: gradle microReload
This task is specifically designed for integration with the IDEs and Editors. Payara Micro instance allows IDEs to deploy the application in Hot Deploy mode by reusing the existing application instance and updating its classloader and internal components relative to the modified source. This can lead to significant savings of time when an application is redeployed and boost developer productivity even more. |
Element | Default | Notes |
---|---|---|
|
false |
Enables the hot reload mode. |
|
none |
Defines a list(comma separated) of the absolute paths to the source file which need to be reloaded via the Hot Reload feature. |
|
false |
If set to true, reloads deployment descriptors metadata in hot deploy mode |