Professional Documents
Culture Documents
https://docs.wildfly.org/31/Bootable_Guide.html 1/17
2024. 03. 10. 10:19 Bootable JAR Guide
https://docs.wildfly.org/31/Bootable_Guide.html 2/17
2024. 03. 10. 10:19 Bootable JAR Guide
https://docs.wildfly.org/31/Bootable_Guide.html 3/17
2024. 03. 10. 10:19 Bootable JAR Guide
Developing an application packaged as a bootable JAR is not different from developing an application for a traditional
WildFly server installation using Maven. The extra steps required to package your application inside a bootable JAR are
handled by the org.wildfly.plugins:wildfly-jar-maven-plugin (https://github.com/wildfly-extras/wildfly-jar-maven-plugin) Maven
plugin.
This document contains the minimal information set required to build and run a WildFly bootable JAR. Complete
information on the Maven plugin usage can be found in the bootable JAR documentation
(https://docs.wildfly.org/bootablejar/).
https://docs.wildfly.org/31/Bootable_Guide.html 4/17
2024. 03. 10. 10:19 Bootable JAR Guide
XML
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-jar-maven-plugin</artifactId>
<configuration>
...
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
The next chapter covers the plugin configuration items that are required to identify the WildFly server version and
content.
https://docs.wildfly.org/31/Bootable_Guide.html 5/17
2024. 03. 10. 10:19 Bootable JAR Guide
2. Galleon configuration
The Bootable JAR Maven plugin depends on Galleon (https://docs.wildfly.org/galleon/) to construct the WildFly server
contained in the JAR file.
The first required piece of information that Galleon needs is a reference to the WildFly Galleon feature-pack. The
WildFly Galleon feature-pack is a maven artifact that contains everything needed to dynamically provision a server.
This feature-pack, as well as the feature-packs on which its depends, are deployed in public maven repositories.
When the bootable JAR Maven plugin builds a JAR, WildFly feature-packs are retrieved and their content is assembled
to create the server contained in the JAR.
Once you have identified a WildFly Galleon feature-pack, you need to select a set of WildFly Layers that are used to
compose the server.
The set of Galleon layers to include is driven by the needs of the application you are developing. The list of WildFly
Layers provides details on the server features that each layer brings. Make sure that the API and server features you
are using (eg: Jakarta RESTful Web Services, MicroProfile Config, datasources) are provided by the layers you are
choosing.
If you decide not to specify Galleon layers, a server containing all MicroProfile subsystems is provisioned. (The server
configuration is identical to the standalone-microprofile.xml configuration in the traditional WildFly server zip.)
XML
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-jar-maven-plugin</artifactId>
<configuration>
<feature-pack-location>wildfly@maven(org.jboss.universe:community-universe)</feature-pack-location> (1)
<layers>
<layer>jaxrs-server</layer> (2)
</layers>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
(1) In this plugin configuration extract, we are retrieving the latest WildFly Galleon feature-pack installed in the
org.jboss.universe:community-universe Galleon universe. In case you would like to provision a specific version of
the server, you would need to specify the server version, for example wildfly@maven(org.jboss.universe:community-
universe)#21.0.0.Final
(2) The jaxrs-server layer and all its dependencies are provisioned.
https://docs.wildfly.org/31/Bootable_Guide.html 6/17
2024. 03. 10. 10:19 Bootable JAR Guide
A piece of server XML configuration (e.g.: extension, configured subsystem, interfaces) that describes the capability.
A set of modules and other filesystem content that implements the capability.
When you are using a layer, it delivers these pieces of information in order for Galleon to assemble a server containing
only the required configuration and modules.
In the tables below we provide basic information about all of the layers WildFly provides.
Besides the layer names and a brief description of each, the tables below detail the various dependency relationships
between layers. If the capabilities provided by a layer A require capabilities provided by another layer B, then layer A
will depend on layer B. If you ask for layer A, then Galleon will automatically provide B as well. In some cases A’s
dependency on B can be optional; that is A typically comes with B, but can function without it. In this case if you ask for
A by default Galleon will provide B as well, but you can tell Galleon to exclude B.
Some layers are logical alternatives to other layers. If two layers are alternatives to each other they both provide the
same general capabilities, but with different implementation characteristics. For example a number of layers provide
the capability to cache different types of objects. These layers typically come in pairs of alternatives, where one
alternative provides local caching, while the other provides distributed caching. If a layer you want has an optional
dependency on a layer that has an alternative, you can exclude that dependency and instead specify the alternative. If
a layer has an alternative the Description column in the tables below will identify it.
If the elytron layer is present, security will be handled by the elytron subsystem. The undertow and
ejb subsystems are configured with an other application-security-domain that references the Elytron
ApplicationDomain security domain.
You don’t have to base your WildFly installation on one of these foundational layers, but doing so may be more
convenient.
https://docs.wildfly.org/31/Bootable_Guide.html 7/17
2024. 03. 10. 10:19 Bootable JAR Guide
core-server A typical manageable server core. This layer could serve core-management
as a base for a more specialized WildFly that doesn’t (optional)
need the capabilities provided by the other foundational jmx-remoting (optional)
layers. logging (optional)
management (optional)
request-controller
(optional)
security-manager
(optional)
https://docs.wildfly.org/31/Bootable_Guide.html 8/17
2024. 03. 10. 10:19 Bootable JAR Guide
cloud-profile An aggregation of some basic layers to address cloud use bean-validation (optional)
cases. cdi (optional)
ee-security (optional)
jaxrs (optional)
jms-activemq (optional)
jpa (optional)
observability (optional)
resource-adapters
(optional)
web-server
core-tools Support for jboss-cli, add-user and elytron-tool launch management (optional)
scripts and configuration files.
ejb Support for Jakarta Enterprise Beans, excluding the IIOP ejb-lite
protocol. messaging-activemq
remoting
resource-adapters
undertow
https://docs.wildfly.org/31/Bootable_Guide.html 9/17
2024. 03. 10. 10:19 Bootable JAR Guide
hibernate-search Support for Hibernate Search. The jpa dependency can jpa (optional)
be excluded and jpa-distributed used instead.
jaxrs Support for Jakarta RESTful Web Services with optional deployment-scanner
ee-concurrency and deployment scanner layers. (optional)
ee-concurrency (optional)
jaxrs-core
jpa Support for JPA (using the latest WildFly supported bean-validation (optional)
Hibernate release). datasources
Alternative: jpa-distributed
jpa-distributed Support for JPA with a distributed second level cache. bean-validation (optional)
Alternative: jpa datasources
https://docs.wildfly.org/31/Bootable_Guide.html 10/17
2024. 03. 10. 10:19 Bootable JAR Guide
https://docs.wildfly.org/31/Bootable_Guide.html 11/17
2024. 03. 10. 10:19 Bootable JAR Guide
mvc-krazo Support for Jakarta MVC (WildFly Preview only unless the bean-validation
wildfly-mvc-krazo-feature-pack cdi
(https://github.com/wildfly-extras/mvc-krazo-feature- jaxrs-core
pack/blob/main/README.md) jsf (optional)
is used)
https://docs.wildfly.org/31/Bootable_Guide.html 12/17
2024. 03. 10. 10:19 Bootable JAR Guide
undertow Support for the Undertow HTTP server. Provides servlet base-server
support but does not provide typical EE integration like io
resource injection. Use web-server for a servlet
container with EE integration.
undertow-https Support for the Undertow HTTPS server secured using elytron
the applicationSSC SSLContext. undertow
web-console Support for loading the HAL web console from the management
/console context on the HTTP management interface.
Not required to use a HAL console obtained
independently and configured to connect to the server.
https://docs.wildfly.org/31/Bootable_Guide.html 13/17
2024. 03. 10. 10:19 Bootable JAR Guide
References in this document to Java Persistence API (JPA) refer to the Jakarta Persistence unless
otherwise noted. References in this document to Enterprise JavaBeans (EJB) refer to the Jakarta
Enterprise Beans unless otherwise noted.
https://docs.wildfly.org/31/Bootable_Guide.html 14/17
2024. 03. 10. 10:19 Bootable JAR Guide
3. Additional configuration
The plugin allows you to specify additional configuration items:
A set of WildFly CLI scripts to execute to fine tune the server configuration.
Some extra content to be copied inside the bootable JAR (e.g.: server keystore).
Check this documentation (https://docs.wildfly.org/bootablejar) for more details on how to configure execution of CLI scripts
and to package extra content.
https://docs.wildfly.org/31/Bootable_Guide.html 15/17
2024. 03. 10. 10:19 Bootable JAR Guide
In order to speed-up the development of your application (avoid rebuilding the JAR each time your application is re-
compiled), the Maven plugin offers a development mode that allows you to build and start the bootable JAR only once.
Check this documentation (https://docs.wildfly.org/bootablejar) for more details on the development mode.
https://docs.wildfly.org/31/Bootable_Guide.html 16/17
2024. 03. 10. 10:19 Bootable JAR Guide
In additon, you can use the wildfly-jar:run and wildfly-jar:start plugin goals to launch the bootable JAR.
Option Description
--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 Application to install in the hollow JAR. Adding a
deployment directory> deployment to an bootable JAR already containing a
deployment is invalid.
--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 ).
Version 31.0.0.Final
Last updated 2023-07-25 20:50:17 -0500
https://docs.wildfly.org/31/Bootable_Guide.html 17/17