title: How to generate a ddl creation script with a modern Spring Boot + Data JPA and Hibernate setup?
body: <p>Currently, I'm using the default <code>@SpringBootApplication</code> annotation with the following properties in <code>application.properties</code>:</p>
  
  <pre><code>spring.datasource.url=jdbc:mysql://localhost/dbname
  spring.datasource.username=X
  spring.datasource.password=X
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  spring.jpa.hibernate.naming_strategy=my.package.CustomNamingStrategy
  </code></pre>
  
  <p>Since JPA 2.1, I should be able to use the <code>javax.persistence.schema-generation.*</code> properties, but setting them in my application.properties seems to have no effect.</p>
  
  <p>I've seen examples <a href="https://gist.github.com/jbrackett/8899299" rel="noreferrer">like this</a> that wire up a whole bunch of extra beans, but they aren't using Mysql. And in any case, doing it like that requires me to configure many options that spring is taking care of for me now.</p>
  
  <p>My goals are to:</p>
  
  <ul>
  <li>Generate a schema creation sql script in the MYSQL dialect</li>
  <li>without a database connection being required</li>
  <li>Output the script in the build directory</li>
  <li>Also generating hibernate envers tables would be a huge plus.</li>
  </ul>
  
  <p>I do not want to:</p>
  
  <ul>
  <li>Create/drop schemas on a live database</li>
  </ul>
  
  <p>Lib versions:</p>
  
  <pre><code>   hibernate          : 4.3.11.FINAL
     spring framework   : 4.2.5.RELEASE
     spring-boot        : 1.3.3.RELEASE
     spring-data-jpa    : 1.10.1.RELEASE   // for  querydsl 4 support
     spring-data-commons: 1.12.1.RELEASE   // for  querydsl 4 support
  </code></pre>
  
  <p>(Using gradle, not maven)</p>