Introduction

DDL Generator is a Maven plugin to generate DDL file from a Maven project using JPA/Hibernate. It has been created as a (very) partial replacement of the Maven Hibernate3 Plugin which is not working under Hibernate 4.

Features

Usage

Goals

The plugin has one goal: generate. It takes the following mandatory parameters:

And the following optional parameters:

Configuration

The following configuration needs to be inserted in the pom.xml file:

<plugin>
    <groupId>net.ggtools.maven</groupId>
    <artifactId>ddlgenerator-maven-plugin</artifactId>
    <version>0.1</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
                <ddlFile>${project.build.directory}/sql/schema.sql</ddlFile>
                <!--<defaultSchema></defaultSchema>-->
                <dialect>org.hibernate.dialect.H2Dialect</dialect>
                <!--<namingStrategy></namingStrategy>-->
                <persistenceUnitName>MultiPU</persistenceUnitName>
                <persistenceXmlLocations>
                    <param>classpath*:/META-INF/persistence.xml</param>
                    <param>classpath*:/META-INF/persistence-*.xml</param>
                </persistenceXmlLocations>
                <useNewGenerator>true</useNewGenerator>
            </configuration>
        </execution>
    </executions>
</plugin>

Source and Issue tracking

The source repository and issue tracking is hosted on GitHub.

History