© The WildFly Authors.

WildFly bootable JAR application development

The usage of the WildFly Bootable JAR Maven plugin has been deprecated. This documentation covers its usage. This chapter covers the creation of a bootable JAR using the WildFly Maven Plugin.

This document details the steps to follow in order to develop a WildFly application packaged as a bootable JAR. A WildFly bootable JAR should target a bare-metal or virtualized platform. For the cloud platform, you should read the WildFly Maven Plugin Guide that explains how to produce a WildFly installation ready to run on the cloud.

Developing an application packaged as a bootable JAR is no different from developing an application using the WildFly Maven Plugin. Additional configuration items instruct the plugin to produce a WildFly Bootable JAR.

1. Configuring the WildFly Maven plugin

Maven Plugin configuration example:

<build>
  <plugins>
    <plugin>
      <groupId>org.wildfly.plugins</groupId>
      <artifactId>wildfly-maven-plugin</artifactId>
      <configuration>
        <feature-packs>
          <feature-pack>
            <location>wildfly@maven(org.jboss.universe:community-universe)</location>
          </feature-pack>
        </feature-packs>
        <layers>
          <layer>jaxrs-server</layer>
        </layers>
        <bootable-jar>true</bootable-jar> (1)
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>package</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

(1) This option will cause the plugin produce a bootable JAR. By default the file server-bootable.jar is generated in the project target directory. You can use the option <bootable-jar-name>[jar name]</bootable-jar-name> to change the jar name.

2. Running your application

Call java -jar <path to bootable JAR> <arguments>

2.1. Bootable JAR arguments

The following arguments can be used when starting the bootable JAR:

Option Description

-b[interface]=<value>

Set system property jboss.bind.address.<interface> to the given value

-b=<value>

Set system property jboss.bind.address to the given value

-D<name>[=<value>]

Set a system property. The system properties are set by the server. They are not set by the bootable JAR JVM.

--help

Display help then exit

--cli-script=<path to CLI script file>

Path to a CLI script to execute when starting the Bootable JAR

--deployment=<path to WAR/JAR/EAR file or exploded deployment directory>

Application to install in the hollow JAR. Adding a deployment to an bootable JAR already containing a deployment is invalid.

--display-galleon-config

Display the content of the Galleon configuration used to build this bootable JAR.

--install-dir=<path to directory to install server in>

By default a new TEMP directory is created. TEMP directory location is controlled by the Java VM (call to Files.createTempDirectory).

--properties=<url>

Load system properties from the given url

-S<name>[=value]

Set a security property

-secmgr

Activate and install the WildFlySecurityManager.

--stability[=value]

Runs the server using a specific stability level. Possible values: [default, community, preview, experimental], Default = community

-u=<value>

Set system property jboss.default.multicast.address to the given value.

--version

Print version and exit.