Dev mode, and deploy utilities for Payara and GlassFish Server. Includes Live Reload functionality for Jakarta Faces applications.
The dev
goal is the centerpiece of this plugin. It provides a streamlined development experience with automatic builds, deployments, and browser refreshing.
To start dev
mode, run the following command:
mvn payara:dev
mvnd payara:dev
This will:
-
Start the Payara/GlassFish server if it’s not already running. The plugin automatically unpacks the server distribution and starts the domain.
-
Build and deploy your application in an exploded WAR format.
-
Open your application in your default web browser.
-
Watch for file changes in the
src/main
directory.
The dev
mode is designed to be intelligent and efficient. Here’s how it handles different scenarios:
-
Initial Run: On the first run, the plugin checks if the application is already deployed and the server is running.
-
If the server is not running, it will be started automatically.
-
If the application is not deployed, it will be compiled and deployed.
-
-
File Changes: When a file is saved, the plugin detects the change and triggers a build and/or redeployment:
-
Source Code Changes: If you change a Java, Kotlin, or other source file, the plugin will recompile the code and then hot-redeploy the application. This is usually much faster than a full redeployment.
-
Resource Changes: If you change a resource file (e.g., XHTML, CSS, JavaScript), the plugin will update the exploded WAR and the changes will be reflected in the browser, often without a full application reload.
-
-
Live Reload: The plugin provides live-reloading capabilities. When you make changes to your application, the browser will automatically refresh to show the latest updates.
The plugin also provides the following goals for more granular control:
-
payara:deploy
: Deploys the application to the server. -
payara:undeploy
: Undeploys the application from the server. -
payara:extract
: Extracts the application server distribution. -
payara:start
: Starts the application server. -
payara:stop
: Stops the application server.
To use the plugin, add the following to your pom.xml
:
<build>
<plugins>
<plugin>
<groupId>com.flowlogix.plugins</groupId>
<artifactId>container-deploy-plugin</artifactId>
<version>LATEST</version>
</plugin>
</plugins>
</build>
The plugin can be configured with the following parameters:
Parameter | Description | Default Value | Property |
---|---|---|---|
|
Administration URL to connect to the Server |
|
|
|
HTTP port where the application is deployed |
|
|
|
Force deployment even if the server says the application is already deployed |
|
|
|
Whether to include libraries from server’s |
|
|
|
Whether to enable availability on the deployed application |
|
|
|
Whether to keep the state of the application on redeploy (secondary option to availabilityenabled) |
|
|