title: Wildfly Plugin - Datasource - Required services that are not installed
body: <p>I'm trying to configure a datasource in Wildfly Maven plugin...</p>
  
  <p>I have searched for solutions but I didn't find!</p>
  
  <p>My project is too basic and I'm following the documentation examples (<a href="https://docs.jboss.org/wildfly/plugins/maven/latest" rel="nofollow noreferrer">https://docs.jboss.org/wildfly/plugins/maven/latest</a>)</p>
  
  <p>I did the following steps:</p>
  
  <p>1)I added MySql Connector dependency in my Pom.xml</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;mysql&lt;/groupId&gt;
      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
      &lt;version&gt;6.0.6&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>2)Wildfly plugin configuration</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.wildfly.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;wildfly-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.2.1.Final&lt;/version&gt;
          &lt;configuration&gt;
              &lt;jboss-home&gt;/opt/wildfly&lt;/jboss-home&gt;
              &lt;filename&gt;${project.build.finalName}.war&lt;/filename&gt;
  
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;MySQL-Driver&lt;/id&gt;
                      &lt;phase&gt;install&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;deploy-artifact&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;groupId&gt;mysql&lt;/groupId&gt;
                              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
                              &lt;version&gt;6.0.6&lt;/version&gt;
                              &lt;name&gt;mysql-connector-java-6.0.6&lt;/name&gt;
                              &lt;driver-name&gt;mysql-connector-java-6.0.6&lt;/driver-name&gt;
                          &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;DataSource&lt;/id&gt;
                          &lt;phase&gt;install&lt;/phase&gt;
                          &lt;configuration&gt;
                              &lt;force&gt;false&lt;/force&gt;
                              &lt;address&gt;subsystem=datasources,data-source=java:/CondominioDS&lt;/address&gt;
                              &lt;resources&gt;
                                  &lt;resource&gt;
                                      &lt;enableResource&gt;true&lt;/enableResource&gt;
                                              &lt;properties&gt;
                                          &lt;jndi-name&gt;java:/CondominioDS&lt;/jndi-name&gt;
                                          &lt;enable&gt;true&lt;/enable&gt;
                                          &lt;connection-url&gt;jdbc:mysql://localhost:3306/Condominio?useSSL=false&lt;/connection-url&gt;
                                          &lt;driver-class&gt;com.mysql.cj.jdbc.Driver&lt;/driver-class&gt;
                                          &lt;driver-name&gt;mysql-connector-java-6.0.6&lt;/driver-name&gt;
                                          &lt;user-name&gt;root&lt;/user-name&gt;
                                          &lt;password&gt;123&lt;/password&gt;
                                      &lt;/properties&gt;
                                  &lt;/resource&gt;
                              &lt;/resources&gt;
                          &lt;retryFailedDeploymentCount&gt;1&lt;/retryFailedDeploymentCount&gt;
                      &lt;/configuration&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;add-resource&lt;/goal&gt;
                          &lt;/goals&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;deploy&lt;/id&gt;
                          &lt;phase&gt;install&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;deploy&lt;/goal&gt;
                          &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>3)Part of Persistence.xml</p>
  
  <pre><code>&lt;persistence-unit name="Condominio" transaction-type="JTA"&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;jta-data-source&gt;java:/CondominioDS&lt;/jta-data-source&gt;
  </code></pre>
  
  <p>4) mvn clean install</p>
  
  <p>5) mvn wildfly:start</p>
  
  <p>6) mvn wildfly:deploy</p>
  
  <p>And I get the error below ....</p>
  
  <pre><code>09:47:49,668 INFO  [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location /opt/wildfly/standalone/data/content/06/1a91a0f2082869d2b08334631636973944d062/content
  
  09:47:49,692 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "teste.war" (runtime-name: "teste.war")
  
  09:47:50,941 INFO  [org.jboss.as.jpa] (MSC service thread 1-6) WFLYJPA0002: Read persistence.xml for Condominio
  
  09:47:51,120 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0003: Processing weld deployment teste.war
  
  09:47:51,171 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-3) HV000001: Hibernate Validator 5.2.4.Final
  
  09:47:51,340 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.cj.jdbc.Driver (version 6.0)
  
  09:47:51,375 INFO  [org.jboss.weld.Version] (MSC service thread 1-3) WELD-000900: 2.3.5 (Final)
  
  09:47:51,414 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = teste.war_com.mysql.cj.jdbc.Driver_6_0
  
  09:47:51,546 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" =&gt; "teste.war")]) - failure description:
  
  {
      "WFLYCTL0412: Required services that are not installed:" =&gt; ["jboss.naming.context.java.CondominioDS"],
      "WFLYCTL0180: Services with missing/unavailable dependencies" =&gt; [
          "jboss.persistenceunit.\"teste.war#Condominio\" is missing [jboss.naming.context.java.CondominioDS]",
          "jboss.persistenceunit.\"teste.war#Condominio\".__FIRST_PHASE__ is missing [jboss.naming.context.java.CondominioDS]"
      ]
  }
  
  09:47:51,547 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "teste.war" was rolled back with the following failure message: 
  {
      "WFLYCTL0412: Required services that are not installed:" =&gt; ["jboss.naming.context.java.CondominioDS"],
      "WFLYCTL0180: Services with missing/unavailable dependencies" =&gt; [
          "jboss.persistenceunit.\"teste.war#Condominio\" is missing [jboss.naming.context.java.CondominioDS]",
          "jboss.persistenceunit.\"teste.war#Condominio\".__FIRST_PHASE__ is missing [jboss.naming.context.java.CondominioDS]"
      ]
  }
  </code></pre>