{"id":32278,"date":"2014-10-31T13:00:43","date_gmt":"2014-10-31T11:00:43","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=32278"},"modified":"2014-10-30T21:26:02","modified_gmt":"2014-10-30T19:26:02","slug":"configure-jboss-wildfly-datasource-with-maven","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html","title":{"rendered":"Configure JBoss \/ Wildfly Datasource with Maven"},"content":{"rendered":"<p>Most Java EE applications use database access in their business logic, so developers are often faced with the need to configure drivers and database connection properties in the application server. In this post, we are going to automate that task for JBoss \/ <a href=\"http:\/\/wildfly.org\">Wildfly<\/a> and a Postgre database using <a href=\"http:\/\/maven.apache.org\">Maven<\/a>. The work is based on my World of Warcraft Auctions Batch application from the previous <a href=\"http:\/\/www.javacodegeeks.com\/2014\/10\/java-ee-7-batch-processing-and-world-of-warcraft-part-1.html\">post<\/a>.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<h2>Maven Configuration<\/h2>\n<p>Let\u2019s start by adding the following to our <code>pom.xml<\/code>:<\/p>\n<p><em>Wildfly Maven Plugin<\/em><\/p>\n<pre class=\"brush:xml\"><plugin>\r\n    <groupId>org.wildfly.plugins<\/groupId>\r\n    <artifactId>wildfly-maven-plugin<\/artifactId>\r\n    <version>1.0.2.Final<\/version>\r\n    <configuration>\r\n        <executeCommands>\r\n            <batch>false<\/batch>\r\n            <scripts>\r\n                <script>target\/scripts\/${cli.file}<\/script>\r\n            <\/scripts>\r\n        <\/executeCommands>\r\n    <\/configuration>\r\n    <dependencies>\r\n        <dependency>\r\n            <groupId>org.postgresql<\/groupId>\r\n            <artifactId>postgresql<\/artifactId>\r\n            <version>9.3-1102-jdbc41<\/version>\r\n        <\/dependency>\r\n    <\/dependencies>\r\n<\/plugin><\/pre>\n<p>We are going to use the <a href=\"https:\/\/docs.jboss.org\/wildfly\/plugins\/maven\/latest\/\">Wildfly Maven Plugin<\/a> to execute scripts with commands in the application server. Note that we also added a dependency to the Postgre driver. This is for <a href=\"http:\/\/maven.apache.org\">Maven<\/a> to download the dependency, because we are going to need it later to add it to the server. There is also a <code>${cli.file}<\/code> property that is going to be assigned to a profile. This is to indicate which script we want to execute.<\/p>\n<p>Let\u2019s also add the following to the <code>pom.xml<\/code>:<\/p>\n<p><em>Maven Resources Plugin<\/em><\/p>\n<pre class=\"brush:xml\"><plugin>\r\n    <groupId>org.apache.maven.plugins<\/groupId>\r\n    <artifactId>maven-resources-plugin<\/artifactId>\r\n    <version>2.6<\/version>\r\n    <executions>\r\n        <execution>\r\n            <id>copy-resources<\/id>\r\n            <phase>process-resources<\/phase>\r\n            <goals>\r\n                <goal>copy-resources<\/goal>\r\n            <\/goals>\r\n            <configuration>\r\n                <outputDirectory>${basedir}\/target\/scripts<\/outputDirectory>\r\n                <resources>\r\n                    <resource>\r\n                        <directory>src\/main\/resources\/scripts<\/directory>\r\n                        <filtering>true<\/filtering>\r\n                    <\/resource>\r\n                <\/resources>\r\n                <filters>\r\n                    <filter>${basedir}\/src\/main\/resources\/configuration.properties<\/filter>\r\n                <\/filters>\r\n            <\/configuration>\r\n        <\/execution>\r\n    <\/executions>\r\n<\/plugin><\/pre>\n<p>With the <a href=\"http:\/\/maven.apache.org\/plugins\/maven-resources-plugin\/\">Resources Maven Plugin<\/a> we are going to filter the script files contained in the <code>src\/main\/resources\/scripts<\/code> and replace them with the properties contained in <code>${basedir}\/src\/main\/resources\/configuration.properties<\/code> file.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Finally lets add a few Maven profiles to the <code>pom.xml<\/code>, with the scripts that we want to run:<\/p>\n<p><em>Maven Profiles<\/em><\/p>\n<pre class=\"brush:xml\"><profiles>\r\n    <profile>\r\n        <id>install-driver<\/id>\r\n        <properties>\r\n            <cli.file>wildfly-install-postgre-driver.cli<\/cli.file>\r\n        <\/properties>\r\n    <\/profile>\r\n\r\n    <profile>\r\n        <id>remove-driver<\/id>\r\n        <properties>\r\n            <cli.file>wildfly-remove-postgre-driver.cli<\/cli.file>\r\n        <\/properties>\r\n    <\/profile>\r\n\r\n    <profile>\r\n        <id>install-wow-auctions<\/id>\r\n        <properties>\r\n            <cli.file>wow-auctions-install.cli<\/cli.file>\r\n        <\/properties>\r\n    <\/profile>\r\n\r\n    <profile>\r\n        <id>remove-wow-auctions<\/id>\r\n        <properties>\r\n            <cli.file>wow-auctions-remove.cli<\/cli.file>\r\n        <\/properties>\r\n    <\/profile>\r\n<\/profiles><\/pre>\n<h2>Wildfly Script Files<\/h2>\n<h3>Add Driver<\/h3>\n<p>The scripts with the commands to add a Driver:<\/p>\n<h4>wildfly-install-postgre-driver.cli<\/h4>\n<pre class=\"brush:bash;wrap-lines:false\"># Connect to Wildfly instance\r\nconnect\r\n\r\n# Create Oracle JDBC Driver Module\r\n# If the module already exists, Wildfly will output a message saying that the module already exists and the script exits.\r\nmodule add \\\r\n    --name=org.postgre \\\r\n    --resources=${settings.localRepository}\/org\/postgresql\/postgresql\/9.3-1102-jdbc41\/postgresql-9.3-1102-jdbc41.jar \\\r\n    --dependencies=javax.api,javax.transaction.api\r\n\r\n# Add Driver Properties\r\n\/subsystem=datasources\/jdbc-driver=postgre: \\\r\n    add( \\\r\n        driver-name=\"postgre\", \\\r\n        driver-module-name=\"org.postgre\")<\/pre>\n<p>Database drivers are added to <a href=\"http:\/\/wildfly.org\">Wildfly<\/a> as a module. In this was, the driver is widely available to all the applications deployed in the server. With <code>${settings.localRepository}<\/code> we are pointing into the database driver jar downloaded to your local Maven repository. Remember the dependency that we added into the <a href=\"https:\/\/docs.jboss.org\/wildfly\/plugins\/maven\/latest\/\">Wildfly Maven Plugin<\/a>? It\u2019s to download the driver when you run the plugin and add it to the server. Now, to run the script we execute (you need to have the application server running):<\/p>\n<p><code>mvn process-resources wildfly:execute-commands -P \"install-driver\"<\/code><\/p>\n<p>The <code>process-resources<\/code> lifecycle is needed to replace the properties in the script file. In my case <code>${settings.localRepository}<\/code> is replaced by <code>\/Users\/radcortez\/.m3\/repository\/<\/code>. Check the <code>target\/scripts<\/code> folder. After running the command, you should see the following output in the Maven log:<\/p>\n<pre class=\"brush:java\"> {\"outcome\" =&gt; \"success\"}<\/pre>\n<p>And on the server:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">\r\nINFO  [org.jboss.as.connector.subsystems.datasources] (management-handler-thread - 4) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.3)\r\nINFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010417: Started Driver service with driver-name = postgre<\/pre>\n<h4>wildfly-remove-postgre-driver.cli<\/h4>\n<pre class=\"brush:bash\"># Connect to Wildfly instance\r\nconnect\r\n\r\nif (outcome == success) of \/subsystem=datasources\/jdbc-driver=postgre:read-attribute(name=driver-name)\r\n\r\n    # Remove Driver\r\n    \/subsystem=datasources\/jdbc-driver=postgre:remove\r\n\r\nend-if\r\n\r\n# Remove Oracle JDBC Driver Module\r\nmodule remove --name=org.postgre<\/pre>\n<p>This script is to remove the driver from the application server. Execute <code>mvn wildfly:execute-commands -P \"remove-driver\"<\/code>. You don\u2019t need <code>process-resources<\/code> if you already executed the command before, unless you change the scripts.<\/p>\n<h3>Add Datasource<\/h3>\n<h4>wow-auctions-install.cli<\/h4>\n<p>The scripts with the commands to add a Datasource:<\/p>\n<p><em>wow-auctions-install.cli<\/em><\/p>\n<pre class=\"brush:bash\"># Connect to Wildfly instance\r\nconnect\r\n\r\n# Create Datasource\r\n\/subsystem=datasources\/data-source=WowAuctionsDS: \\\r\n    add( \\\r\n    \tjndi-name=\"${datasource.jndi}\", \\\r\n    \tdriver-name=postgre, \\\r\n    \tconnection-url=\"${datasource.connection}\", \\\r\n    \tuser-name=\"${datasource.user}\", \\\r\n    \tpassword=\"${datasource.password}\")\r\n\r\n\/subsystem=ee\/service=default-bindings:write-attribute(name=\"datasource\", value=\"${datasource.jndi}\")<\/pre>\n<p>We also need a a file to define the properties:<\/p>\n<h4>configuration.properties<\/h4>\n<pre class=\"brush:bash\">datasource.jndi=java:\/datasources\/WowAuctionsDS\r\ndatasource.connection=jdbc:postgresql:\/\/localhost:5432\/wowauctions\r\ndatasource.user=wowauctions\r\ndatasource.password=wowauctions<\/pre>\n<h3>Default Java EE 7 Datasource<\/h3>\n<p>Java EE 7, specifies that the container should provide a default Datasource. Instead of defining a Datasource with the JNDI name <code>java:\/datasources\/WowAuctionsDS<\/code> in the application, we are going to point our newly created datasource to the default one with <code>\/subsystem=ee\/service=default-bindings:write-attribute(name=\"datasource\", value=\"${datasource.jndi}\")<\/code>. In this way, we don\u2019t need to change anything in the application. Execute the script with <code>mvn wildfly:execute-commands -P \"install-wow-auctions\"<\/code>. You should get the following Maven output:<\/p>\n<pre class=\"brush:java\">\r\norg.jboss.as.cli.impl.CommandContextImpl printLine\r\nINFO: {\"outcome\" => \"success\"}\r\n{\"outcome\" => \"success\"}\r\norg.jboss.as.cli.impl.CommandContextImpl printLine\r\nINFO: {\"outcome\" => \"success\"}\r\n{\"outcome\" => \"success\"}<\/pre>\n<p>And on the server:<\/p>\n<pre class=\"brush:java;wrap-lines:false\">INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source <\/pre>\n<h4>wow-auctions-remove.cli<\/h4>\n<pre class=\"brush:java;wrap-lines:false\"># Connect to Wildfly instance\r\nconnect\r\n\r\n# Remove Datasources\r\n\/subsystem=datasources\/data-source=WowAuctionsDS:remove\r\n\r\n\/subsystem=ee\/service=default-bindings:write-attribute(name=\"datasource\", value=\"java:jboss\/datasources\/ExampleDS\")<\/pre>\n<p>This is the script to remove the Datasource and revert the Java EE 7 default Datasource. Run it by executing <code>mvn wildfly:execute-commands -P \"remove-wow-auctions\"<\/code><\/p>\n<h2>Conclusion<\/h2>\n<p>This post demonstrated how to automate add \/ remove Drivers to Wildfly instances and also add \/ remove Datasources. This is useful if you want to switch between databases or if you\u2019re configuring a server from the ground up. Think about CI environments. These scripts are also easily adjustable to other drivers.<\/p>\n<ul>\n<li>You can get the code from the <a href=\"https:\/\/github.com\/radcortez\/wow-auctions\">WoW Auctions Github repo<\/a>, which uses this setup.<\/li>\n<\/ul>\n<p>Enjoy!<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/www.radcortez.com\/configure-jboss-wildfly-datasource-with-maven\/\">Configure JBoss \/ Wildfly Datasource with Maven<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\/\">JCG partner<\/a> Roberto Cortez at the <a href=\"http:\/\/www.radcortez.com\/\">Roberto Cortez Java Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Most Java EE applications use database access in their business logic, so developers are often faced with the need to configure drivers and database connection properties in the application server. In this post, we are going to automate that task for JBoss \/ Wildfly and a Postgre database using Maven. The work is based on &hellip;<\/p>\n","protected":false},"author":592,"featured_media":73,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[68,890],"class_list":["post-32278","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-maven","tag-jboss-wildfly"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Configure JBoss \/ Wildfly Datasource with Maven<\/title>\n<meta name=\"description\" content=\"Most Java EE applications use database access in their business logic, so developers are often faced with the need to configure drivers and database\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Configure JBoss \/ Wildfly Datasource with Maven\" \/>\n<meta property=\"og:description\" content=\"Most Java EE applications use database access in their business logic, so developers are often faced with the need to configure drivers and database\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/radcortez\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-31T11:00:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Roberto Cortez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/radcortez\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Roberto Cortez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html\"},\"author\":{\"name\":\"Roberto Cortez\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/d8791115988e922dbffae8d09223a72e\"},\"headline\":\"Configure JBoss \\\/ Wildfly Datasource with Maven\",\"datePublished\":\"2014-10-31T11:00:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html\"},\"wordCount\":594,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"keywords\":[\"Apache Maven\",\"JBoss WildFly\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html\",\"name\":\"Configure JBoss \\\/ Wildfly Datasource with Maven\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"datePublished\":\"2014-10-31T11:00:43+00:00\",\"description\":\"Most Java EE applications use database access in their business logic, so developers are often faced with the need to configure drivers and database\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/configure-jboss-wildfly-datasource-with-maven.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Configure JBoss \\\/ Wildfly Datasource with Maven\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/d8791115988e922dbffae8d09223a72e\",\"name\":\"Roberto Cortez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b40fa2b3df6cfc7ad81ed1509ed2a17fe6a200e409fb0aa8d9e2ab72b64b684?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b40fa2b3df6cfc7ad81ed1509ed2a17fe6a200e409fb0aa8d9e2ab72b64b684?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b40fa2b3df6cfc7ad81ed1509ed2a17fe6a200e409fb0aa8d9e2ab72b64b684?s=96&d=mm&r=g\",\"caption\":\"Roberto Cortez\"},\"description\":\"My name is Roberto Cortez and I was born in Venezuela, but I have spent most of my life in Coimbra \u2013 Portugal, where I currently live. I am a professional Java Developer working in the software development industry, with more than 8 years of experience in business areas like Finance, Insurance and Government. I work with many Java based technologies like JavaEE, Spring, Hibernate, GWT, JBoss AS and Maven just to name a few, always relying on my favorite IDE: IntelliJ IDEA. Most recently, I became a Freelancer \\\/ Independent Contractor. My new position is making me travel around the world (an old dream) to customers, but also to attend Java conferences. The direct contact with the Java community made me want to become an active member in the community itself. For that reason, I have created the Coimbra Java User Group, started to contribute to Open Source on Github and launched my own blog (www.radcortez.com), so I can share some of the knowledge that I gained over the years.\",\"sameAs\":[\"http:\\\/\\\/www.radcortez.com\\\/\",\"https:\\\/\\\/www.facebook.com\\\/radcortez\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/radcortez\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/radcortez\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/roberto-cortez\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Configure JBoss \/ Wildfly Datasource with Maven","description":"Most Java EE applications use database access in their business logic, so developers are often faced with the need to configure drivers and database","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html","og_locale":"en_US","og_type":"article","og_title":"Configure JBoss \/ Wildfly Datasource with Maven","og_description":"Most Java EE applications use database access in their business logic, so developers are often faced with the need to configure drivers and database","og_url":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/www.facebook.com\/radcortez","article_published_time":"2014-10-31T11:00:43+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","type":"image\/jpeg"}],"author":"Roberto Cortez","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/radcortez","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Roberto Cortez","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html"},"author":{"name":"Roberto Cortez","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/d8791115988e922dbffae8d09223a72e"},"headline":"Configure JBoss \/ Wildfly Datasource with Maven","datePublished":"2014-10-31T11:00:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html"},"wordCount":594,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","keywords":["Apache Maven","JBoss WildFly"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html","url":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html","name":"Configure JBoss \/ Wildfly Datasource with Maven","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","datePublished":"2014-10-31T11:00:43+00:00","description":"Most Java EE applications use database access in their business logic, so developers are often faced with the need to configure drivers and database","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/configure-jboss-wildfly-datasource-with-maven.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Configure JBoss \/ Wildfly Datasource with Maven"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/d8791115988e922dbffae8d09223a72e","name":"Roberto Cortez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3b40fa2b3df6cfc7ad81ed1509ed2a17fe6a200e409fb0aa8d9e2ab72b64b684?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3b40fa2b3df6cfc7ad81ed1509ed2a17fe6a200e409fb0aa8d9e2ab72b64b684?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3b40fa2b3df6cfc7ad81ed1509ed2a17fe6a200e409fb0aa8d9e2ab72b64b684?s=96&d=mm&r=g","caption":"Roberto Cortez"},"description":"My name is Roberto Cortez and I was born in Venezuela, but I have spent most of my life in Coimbra \u2013 Portugal, where I currently live. I am a professional Java Developer working in the software development industry, with more than 8 years of experience in business areas like Finance, Insurance and Government. I work with many Java based technologies like JavaEE, Spring, Hibernate, GWT, JBoss AS and Maven just to name a few, always relying on my favorite IDE: IntelliJ IDEA. Most recently, I became a Freelancer \/ Independent Contractor. My new position is making me travel around the world (an old dream) to customers, but also to attend Java conferences. The direct contact with the Java community made me want to become an active member in the community itself. For that reason, I have created the Coimbra Java User Group, started to contribute to Open Source on Github and launched my own blog (www.radcortez.com), so I can share some of the knowledge that I gained over the years.","sameAs":["http:\/\/www.radcortez.com\/","https:\/\/www.facebook.com\/radcortez","https:\/\/www.linkedin.com\/in\/radcortez","https:\/\/x.com\/https:\/\/twitter.com\/radcortez"],"url":"https:\/\/www.javacodegeeks.com\/author\/roberto-cortez"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/32278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/592"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=32278"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/32278\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/73"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=32278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=32278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=32278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}