title: Hibernate + Maven + hbm2ddl?
body: <p>I'm maintaining a project with some Hibernate and a Maven build step do generate some SQL script. That is failing with this error:</p>
  
  <p><code>java.lang.UnsupportedOperationException: The user must supply a JDBC connection</code></p>
  
  <p>Does this just take configuration files or source code annotation configuration and generate SQL script? Why does it need a database? I don't normally have a database setup to build. How do I fix the error?</p>
  
  <p>This is relevant piece from the Maven pom.xml:</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate3-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.0&lt;/version&gt;
  
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;generate-ddl&lt;/id&gt;
                      &lt;phase&gt;process-classes&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;hbm2ddl&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
  
              &lt;configuration&gt;
                  &lt;hibernatetool destdir="target/classes/db_scripts"&gt;
                      &lt;jpaconfiguration persistenceunit="myPersistenceUnit" /&gt;
  
                      &lt;hbm2ddl export="false" create="true" drop="false"
                              update="true" format="true" outputfilename="GeneratedDdlSchema.sql" /&gt;
                  &lt;/hibernatetool&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  </code></pre>