Plugin Documentation

This report describes goals, parameters details, requirements and sample usage of this plugin.

Goals

Goals available for this plugin:

Goal Description
wildfly:add-resource Adds a resource

If force is set to false and the resource has already been added to the server, an error will occur and the operation will fail.

wildfly:deploy Deploys the application to the WildFly Application Server.

If force is set to true, the server is queried to see if the application already exists. If the application already exists, the application is redeployed instead of deployed. If the application does not exist the application is deployed as normal.

If force is set to false and the application has already been deployed to the server, an error will occur and the deployment will fail.
wildfly:deploy-artifact Deploys an arbitrary artifact to the WildFly application server
wildfly:deploy-only Deploys only the application to the WildFly Application Server without first invoking the the execution of the lifecycle phase 'package' prior to executing itself.

If force is set to true, the server is queried to see if the application already exists. If the application already exists, the application is redeployed instead of deployed. If the application does not exist the application is deployed as normal.

If force is set to false and the application has already been deployed to the server, an error will occur and the deployment will fail.
wildfly:dev Starts a standalone instance of WildFly and deploys the application to the server. The deployment type must be a WAR. Once the server is running, the source directories are monitored for changes. If required the sources will be compiled and the deployment may be redeployed.

Note that changes to the POM file are not monitored. If changes are made the POM file, the process will need to be terminated and restarted.

Note that if a WildFly Bootable JAR is packaged, it is ignored by this goal.

wildfly:execute-commands Execute commands to the running WildFly Application Server.

Commands should be formatted in the same manner CLI commands are formatted.

Executing commands in a batch will rollback all changes if one command fails.
     <batch>true</batch>
     <fail-on-error>false</fail-on-error>
     <commands>
         <command>/subsystem=logging/console=CONSOLE:write-attribute(name=level,value=DEBUG)</command>
     </commands>
wildfly:help Display help information on wildfly-maven-plugin.
Call mvn wildfly:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
wildfly:image Build (and push) an application image containing the provisioned server and the deployment.

The image goal extends the package goal, building and pushing the image occurs after the server is provisioned and the deployment deployed in it.

The image goal relies on a Docker binary to execute all image commands (build, login, push).

Note that if a WildFly Bootable JAR is packaged, it is ignored when building the image.

wildfly:package Provision a server, copy extra content and deploy primary artifact if it exists.

Additional deployments can also be resolved from the dependencies. Use the <included-dependencies/>, <excluded-dependencies/>, <included-dependency-scope/> and/or <excluded-dependency-scope/> to deploy additional artifacts to the packaged server.

Note the <included-dependencies/>, <excluded-dependencies/>, included-dependency-scope and <excluded-ependency-scope/> configuration properties are chained together and all checks must pass to be included as additional deployments.

wildfly:provision Provision a server.
wildfly:redeploy Redeploys the application to the WildFly Application Server.
wildfly:redeploy-only Redeploys only the application to the WildFly Application Server without first invoking the the execution of the lifecycle phase 'package' prior to executing itself.
wildfly:run Starts a standalone instance of WildFly and deploys the application to the server.

This goal will block until cancelled or a shutdown is invoked from a management client.

Note that if a WildFly Bootable JAR is packaged, it is ignored by this goal.

wildfly:shutdown Shuts down a running WildFly Application Server.

Can also be used to issue a reload instead of a full shutdown. If a reload is executed the process will wait for the serer to be available before returning.
wildfly:start Starts a standalone instance of WildFly Application Server.

The purpose of this goal is to start a WildFly Application Server for testing during the maven lifecycle.

Note that if a WildFly Bootable JAR is packaged, it is ignored by this goal.

wildfly:start-jar Starts a WildFly Application Server packaged as Bootable JAR.

The purpose of this goal is to start a WildFly Application Server packaged as a Bootable JAR for testing during the maven lifecycle.
wildfly:undeploy Undeploys the application to the WildFly Application Server.
wildfly:undeploy-artifact Undeploys (removes) an arbitrary artifact to the WildFly application server

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.6.3
JDK 11

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.wildfly.plugins</groupId>
          <artifactId>wildfly-maven-plugin</artifactId>
          <version>5.1.1.Final</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.wildfly.plugins</groupId>
        <artifactId>wildfly-maven-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"