Automated JDBC-Driver and Datasource deployment with Wildfly 8.x

My goal is to configure an enterprise application so that it runs on wildfly out of the box:

  • No need to upload and/or deploy the jdbc driver
  • No need to create the datasource for the application manually
  • The deployment procedure shouldn’t be more complicated than necessary.
    This is true for daily usage – the setup is different hence this document 🙂
  • Externalize configuration details of the db configuration from the build to gain more flexibility


For eager starters: There’s working example (with mysql5) on BitBucket


  • We have a maven based build process
  • we want to connect to an oracle db. According to my experience it works with mysql5 and mongo db, too.
  • For now we assume Wildfly is installed locally.
  • A Property by the name “wildfly-home” existst and points to where wildfly is installed locally. If you followed my description for mac this is most propably:

Steps to take:

  1. Declare the db driver a maven dependency.
  2. Include maven wildfly plugin in the build process
  3. Add an execution step for deploying the jdbc driver
  4. Add another step to deploy the datasource
  5. Add the execution step to deploy the application

ad 1) Add db driver to dependency list


ad 2) add the wildfly maven plugin to the build configuration


ad 3) Configure deployment of jdbc-jar



ad 4) add datasource deployment step


ad 4) add step to deploy the application

<!– deploy the application –>

Since maven wildfly plugin integrates nicely with mavens lifecycle you can install everything with one:

mvn install



This article is based on the information provided by jboss here.

About javavolker71

when i do not write posts on this blog, don't work on or try to break my code i'm spending a reasonable amount of time
This entry was posted in IT, Java, JEE7, maven, Uncategorized and tagged , , , , , . Bookmark the permalink.

11 Responses to Automated JDBC-Driver and Datasource deployment with Wildfly 8.x

  1. Samuel says:

    Did you have an example with a mongoDB datasource ? I can’t do it 😦 I have the same trouble than : :
    {“JBAS014771: Services with missing/unavailable dependencies” => [
    “ is missing [jboss.jdbc-driver.mongo-java-driver-2_10_1_jar]”,
    “ is missing [jboss.jdbc-driver.mongo-java-driver-2_10_1_jar]”
    Any idea ?
    thx 😉


  2. Johnk225 says:

    Hello.This post was extremely motivating, especially because I was browsing for thoughts on this subject last Thursday. aeekdecceeag


  3. Johng156 says:

    You completed a number of fine points there. I did a search on the theme and found the majority of folks will agree with your blog. deedbcfeeeed


  4. Carlo(s) says:

    Hi! I’ve a problem on deploy-artifact stage! I recive this error message: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy-artifact (default-cli) on project Zeus: deploy-artifact must specify the artifactId -> [Help 1]
    Can you help me with this?


    • javavolker71 says:

      Hey Carlo(s),

      hmm, the artifact your going to deploy has to be declared as a project dependency. I would recommend specifying group- and artifactId as properties so you eliminate typos.
      Please refer to the (updated) linked bitbucket project. It contains a complete project for deploying a mysql driver and a datasource.
      If you have further problems or questions we get them sorted out.
      Sorry for the delay – i’ve been on vacation and started a new job.

      Happy coding,


  5. Mastouri says:

    Thanks for the nice article. Unfortunately i can not access the BitBucket repository. Can you give me access? My BitBucket account is amine-mastouri
    Kind regards


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s