title: Datanucleus + Maven: cannot find main class SchemaTool
body: <p>I am trying to make a maven project using Datanucleus as a database abstraction. However, when i try to <code>mvn datanucleus:schema-create</code>, i get the following error:</p>
  
  <pre><code>[ERROR] --------------------
  [ERROR]  Standard error from the DataNucleus tool + org.datanucleus.store.schema.SchemaTool :
  [ERROR] --------------------
  [ERROR] Error: Could not find or load main class org.datanucleus.store.schema.SchemaTool
  </code></pre>
  
  <p>The relevant parts from the pom.xml file are:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.jdo&lt;/groupId&gt;
          &lt;artifactId&gt;jdo-api&lt;/artifactId&gt;
          &lt;version&gt;3.0.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.datanucleus&lt;/groupId&gt;
          &lt;artifactId&gt;datanucleus-core&lt;/artifactId&gt;
          &lt;version&gt;4.0.4&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.datanucleus&lt;/groupId&gt;
          &lt;artifactId&gt;datanucleus-api-jdo&lt;/artifactId&gt;
          &lt;version&gt;4.0.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.datanucleus&lt;/groupId&gt;
          &lt;artifactId&gt;datanucleus-rdbms&lt;/artifactId&gt;
          &lt;version&gt;4.0.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.34&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;!-- &lt;version&gt;3.2&lt;/version&gt; --&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.7&lt;/source&gt;
                  &lt;target&gt;1.7&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.datanucleus&lt;/groupId&gt;
              &lt;artifactId&gt;datanucleus-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;4.0.0-release&lt;/version&gt;
  
  
              &lt;configuration&gt;
                  &lt;api&gt;JDO&lt;/api&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;process-classes&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;enhance&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>And the persistence.xml file is in /src/main/resources/META-INF/persistence.xml, containing the following:</p>
  
  <p>
  http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
      version="2.0"></p>
  
  <pre><code>&lt;!-- JDO tutorial "unit" --&gt;
  &lt;persistence-unit name="Tutorial"&gt;
      &lt;class&gt;a.b.c.MyClass&lt;/class&gt;
      &lt;exclude-unlisted-classes /&gt;
      &lt;properties&gt;
          &lt;property name="javax.jdo.option.PersistenceUnitName" value="Tutorial" /&gt;
          &lt;property name="javax.jdo.option.ConnectionURL" value="jdbc:mysql://localhost/mydb" /&gt;
          &lt;property name="javax.jdo.option.ConnectionDriverName"
              value="com.mysql.jdbc.Driver" /&gt;
          &lt;property name="javax.jdo.option.ConnectionUserName" value="myuser" /&gt;
          &lt;property name="javax.jdo.option.ConnectionPassword" value="mypass" /&gt;
          &lt;property name="datanucleus.schema.autoCreateAll" value="true" /&gt;
          &lt;property name="datanucleus.schema.validateTables" value="true" /&gt;
          &lt;property name="datanucleus.schema.validateConstraints"
              value="true" /&gt;
          &lt;property name="javax.jdo.PersistenceManagerFactoryClass"
              value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory" /&gt;
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p></p>
  
  <p>To my untrained eye it looks like everything is in place, yet it doesn't work.</p>