-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration of multiple datasources (same DB type) #35
Comments
wisteso
changed the title
How to configure multiple datasources?
Configuration of multiple datasources (same DB type)
Apr 8, 2021
@wisteso , yes, for multiple datasources you will need to use WildFly CLI scripts. If you are using Bootable JAR, then CLI scipt execution is integrated in the Maven plugin that produces WildFly Bootable JAR. |
The solution looks like this: <plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-jar-maven-plugin</artifactId>
<version>${wildfly.bootable.jar.plugin.version}</version>
<configuration>
<dump-original-artifacts>true</dump-original-artifacts>
<log-time>true</log-time>
<contextRoot>false</contextRoot> <!-- disable root deployment -->
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#${wildfly.version}</location>
</feature-pack>
<feature-pack>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-datasources-galleon-pack</artifactId>
<version>${wildfly.ds.galleon.version}</version>
</feature-pack>
</feature-packs>
<layers>
<layer>jaxrs-server</layer>
<layer>mail</layer>
<layer>postgresql-driver</layer>
<layer>ejb-lite</layer>
</layers>
<excluded-layers>
<layer>deployment-scanner</layer>
</excluded-layers>
<cli-sessions>
<cli-session>
<script-files>
<script>../wildfly-jar-scripts/server-cfg.cli</script>
</script-files>
<properties-file>wildfly.properties</properties-file>
</cli-session>
<cli-session>
<script-files>
<script>../wildfly-jar-scripts/db.cli</script>
</script-files>
<!-- We want the env variables to be resolved during server execution -->
<resolve-expressions>false</resolve-expressions>
</cli-session>
</cli-sessions>
<extra-server-content-dirs>
<extra-content>../manual/wildfly-jar-extra-content</extra-content>
</extra-server-content-dirs>
<plugin-options>
<jboss-fork-embedded>false</jboss-fork-embedded>
</plugin-options>
<cloud>
<type>kubernetes</type>
</cloud>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin> and db.cli with multiple lines like:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've read the documentation which talks about using environment variables to set the DB user/pass/schema/etc. However, multiple datasources will not work this way unless there's something I'm missing?
Not using OpenShift - Looking for something that will work on bare metal or cloud.
The text was updated successfully, but these errors were encountered: