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 server:devmvnd server:devThis 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/maindirectory.
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.
-
The plugin also provides the following goals for more granular control:
-
server:deploy: Deploys the application to the server. -
server:undeploy: Undeploys the application from the server. -
server:extract: Extracts the application server distribution. -
server:start: Starts the application server. -
server:stop: Stops the application server. -
server:restart: Restarts the application server. -
server:deps: Cleans and copies project dependencies to the server’slib/warlibsdirectory. -
server:clean: Removes all dependencies from the server’slib/warlibsdirectory.
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) |
|
|
|
Name of the application on the server. Applies only to deploy, undeploy or clean goals. Defaults to the project’s final name. |
|
|