Created
August 7, 2013 10:12
-
-
Save taichi/6172803 to your computer and use it in GitHub Desktop.
enable PostgreSQL configuration to Wildfly using Gradle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { runtime 'org.postgresql:postgresql:9.2-1003-jdbc4' } | |
| task installPostgreSQL(type: Copy) { | |
| def postgreJar = configurations.runtime.find { it.name.contains('postgresql') } | |
| def moduleDir = "$jbossHome/modules/system/layers/base/org/postgresql/main" | |
| from postgreJar | |
| into moduleDir | |
| doLast { | |
| file("$moduleDir/module.xml").text = """<?xml version="1.0" encoding="UTF-8"?> | |
| <module xmlns="urn:jboss:module:1.0" name="org.postgresql"> | |
| <resources> | |
| <resource-root path="${postgreJar.name}"/> | |
| </resources> | |
| <dependencies> | |
| <module name="javax.api"/> | |
| <module name="javax.transaction.api"/> | |
| </dependencies> | |
| </module> | |
| """ | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <subsystem xmlns="urn:jboss:domain:datasources:2.0"> | |
| <datasources> | |
| <datasource jndi-name="java:jboss/datasources/PostgreDS" | |
| pool-name="PostgreDS" enabled="true" use-java-context="true"> | |
| <connection-url>jdbc:postgresql://localhost:5432/mydb | |
| </connection-url> | |
| <driver>postgresql</driver> | |
| <security> | |
| <user-name>postgreuser</user-name> | |
| <password>postgrepass</password> | |
| </security> | |
| </datasource> | |
| <drivers> | |
| <driver name="postgresql" driver-class-name="org.postgresql.Driver" | |
| module="org.postgresql"> | |
| <xa-datasource-class>org.postgresql.xa.PGXADataSource | |
| </xa-datasource-class> | |
| </driver> | |
| </drivers> | |
| </datasources> | |
| </subsystem> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment