hibernate5-ddl-maven-plugin

Some time ago I started a project with JPA/Hibernate. Because I wanted to use Flyway for database migrations I needed the SQL for generating the database tables. Because I used Maven in that project I also wanted to integrate the generation of the SQL into the Maven build process. Unfortunately I did not found a suitable Maven plugin for that which worked with Hibernate 4 or Hibernate 5 so I decided to create this little plugin.

Most of this plugin is similar to my plugin for Hibernate 4 (see hibernate4-ddl-maven-plugin).

The plugin (current version 2.1.0) is available from Maven Central. Starting with version 2.0 the plugin in provided in different variants build against the branches of Hibernate currently maintained by the Hibernate theme. At the moment these are Hibernate 5.0, Hibernate 5.1 and Hibernate 5.3. You should use the version of the plugin which is build against the version of Hibernate you are using.

If you are using Hibernate 5.0 add the following to your pom.xml to use the plugin:

<plugin>
    <groupId>de.jpdigital</groupId>
    <artifactId>hibernate50-ddl-maven-plugin</artifactId>
    <version>2.0.4</version>
</plugin>

If your are Hibernate 5.1 the dependency looks like this:

<plugin>
    <groupId>de.jpdigital</groupId>
    <artifactId>hibernate51-ddl-maven-plugin</artifactId>
    <version>2.0.4</version>
</plugin>

And if you are using Hibernate 5.2 use:

<plugin>
    <groupId>de.jpdigital</groupId>
    <artifactId>hibernate52-ddl-maven-plugin</artifactId>
    <version>2.0.4</version>
</plugin>

The sources can be found at GitHub. The project page generated by Maven is also available on GitHub.

If you think you found a bug or have a suggestion for a feature please file a bug a GitHub.