Skip to content

Galleon Feature Packs for integrating datasources into WildFly and WildFly Preview

These feature-packs for WildFly and WildFly Preview provide JDBC drivers and datasources for various databases. The versions of the JDBC drivers can be retrieved from the pom.xml file of the feature-pack version you are using.

The datasources (or datasources-preview) Galleon feature-pack is to be provisioned along with the WildFly (or WildFly Preview) Galleon feature-pack.

The Galleon layers defined in these feature-packs are decorator layers. This means that they need to be provisioned in addition to a WildFly base layer. The WildFly Installation Guide covers the base layers that WildFly defines.

NOTE: The base layer datasources-web-server (that provisions WildFly datasources) is the minimal base layer to use when provisioning Galleon layers that these feature-packs define.

Resources:

Galleon feature-pack compatible with WildFly

The Maven coordinates to use is: org.wildfly:wildfly-datasources-galleon-pack:<version>

Galleon feature-pack compatible with WildFly Preview

The Maven coordinates to use is: org.wildfly:wildfly-datasources-preview-galleon-pack:<version>

Supported database types

For each database type it supports, each feature-pack provides 3 Galleon layers that build upon each other :

  • One just to add the driver (eg: postgresql-driver). This installs a JBoss Modules module for the driver and adds a driver resource to the datasources subsystem in the server configuration.
  • One that builds on the first to add a datasource (eg: postgresql-datasource).
  • One that builds on the second to make the datasource the Jakarta EE default datasource (eg: postgresql-default-datasource).

The linked documentation provides information about how to configure each supported database type:

Using the Datasources Galleon feature-pack

Provisioning of driver and datasources Galleon layers can be done in multiple ways according to the provisioning tooling in use.

Provisioning using CLI tool

You can download the latest Galleon CLI tool from the Galleon github project releases.

You need to define a Galleon provisioning configuration file such as:

<?xml version="1.0" ?>
<installation xmlns="urn:jboss:galleon:provisioning:3.0">
  <feature-pack location="org.wildfly:wildfly-galleon-pack:41.0.0.Final">
    <default-configs inherit="false"/>
    <packages inherit="false"/>
  </feature-pack>
  <feature-pack location="org.wildfly:wildfly-datasources-galleon-pack:11.4.0.Final">
    <default-configs inherit="false"/>
    <packages inherit="false"/>
  </feature-pack>
  <config model="standalone" name="standalone.xml">
    <layers>
      <!-- Base layer -->
      <include name="datasources-web-server"/>
      <include name="postgresql-datasource"/>
      <include name="mysql-datasource"/>
    </layers>
  </config>
  <options>
    <option name="optional-packages" value="passive+"/>
    <option name="jboss-fork-embedded" value="true"/>
  </options>
</installation>

and provision it using the following command:

galleon.sh provision provisioning.xml --dir=my-wildfly-server

Provisioning using the WildFly Maven Plugin or the WildFly JAR Maven plugin

You need to include the datasources feature-pack and layers in the Maven Plugin configuration. This looks like:

...
<feature-packs>
  <feature-pack>
    <location>org.wildfly:wildfly-galleon-pack:41.0.0.Final</location>
  </feature-pack>
  <feature-pack>
    <location>org.wildfly:wildfly-datasources-galleon-pack:11.4.0.Final</location>
  </feature-pack>
</feature-packs>
<layers>
  <!-- Base layer -->
  <layer>jaxrs-server</layer>
  <layer>postgresql-datasource</layer>
</layers>
...

This example contains a complete WildFly Maven Plugin configuration.

Configuring the driver version

Starting with version 11.5.0.Final of the datasources feature-pack, you can provide the driver version as a system property. The documentation of each supported database contains the system property (or environment variable) to use.

For example, to provide postgresql driver version when using the WildFly Maven plugin call:

mvn clean install -Dorg.wildfly.datasources.postgresql.driver.version=42.7.10

You can also configure the properties-maven-plugin in your pom.xml to set the system properties. For example:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>set-system-properties</goal>
            </goals>
            <configuration>
                <properties>
                    <property>
                        <name>org.jboss.eap.datasources.postgresql.driver.version</name>
                        <value>42.7.10</value>
                    </property>
                </properties>
            </configuration>
        </execution>
    </executions>
</plugin>

About

WildFly Feature Pack for DataSources

Resources

Code of conduct

Contributing

Security policy

Stars

20 stars

Watchers

5 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages