How To Purpose Mariadb As Well As Liquibase Together Amongst Maven On Jboss

First you lot must define the needed dependency inwards your pom file.
<profile>  <id>mariadb</id>  <activation>   <property>    <name>env</name>    <value>mariadb</value>   </property>  </activation>  <properties>   <db.driver>org.mariadb.jdbc.Driver</db.driver>   <db.url>jdbc:mariadb://localhost:3306/mariadb</db.url>   <db.username>mariadb</db.username>   <db.password>mariadb</db.password>  </properties>  <dependencies>   <!-- Dependency for liquibase plugin -->   <dependency>    <groupId>org.mariadb.jdbc</groupId>    <artifactId>mariadb-java-client</artifactId>    <version>1.5.4</version>   </dependency>     </dependencies> </profile> 
Then nosotros require to configure jboss datasource
<datasource jta="true"      jndi-name="java:jboss/datasources/MariaDBAdminDatasource" pool-name="MariaDBMariadb"      enabled="true" use-java-context="true" use-ccm="false">  <connection-url>jdbc:mariadb://127.0.0.1:3306/MariaDB</connection-url>  <driver-class>org.mariadb.jdbc.Driver</driver-class>  <driver>mariadb-driver</driver>  <pool>   <min-pool-size>2</min-pool-size>   <max-pool-size>20</max-pool-size>  </pool>  <security>   <user-name>MariaDB</user-name>   <password>MariaDB</password>  </security>  <validation>   <validate-on-match>true</validate-on-match>   <background-validation>true</background-validation>   <check-valid-connection-sql>select 1</check-valid-connection-sql>  </validation>  <statement>   <prepared-statement-cache-size>10</prepared-statement-cache-size>   <share-prepared-statements>false</share-prepared-statements>  </statement> </datasource>  <drivers>  <driver name="mariadb-driver" module="org.mariadb">   <xa-datasource-class>org.mariadb.jdbc.MySQLDataSource</xa-datasource-class>  </driver> </drivers> 
And in conclusion within jboss modules folder nosotros require to practice a novel folder: org\mariadb\main amongst mariadb-java-client-1.5.4.jar together with module.xml. Content of module.xml is:
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.0" name="org.mariadb">   <resources>     <resource-root path="mariadb-java-client-1.5.4.jar"/>   </resources>   <dependencies>     <module name="javax.api"/>     <module name="javax.transaction.api"/>   </dependencies> </module>  
Next
Previous
Click here for Comments

0 komentar:

Please comment if there are any that need to be asked.