Вот мой пример конфигурации для HSQLdb, который генерирует src/main/resources/db-scheme.sql
:
From pom.xml
:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
<outputDirectory>
src/main/resources
</outputDirectory>
</component>
</components>
<componentProperties>
<console>false</console>
<format>true</format>
<jdk5>true</jdk5>
<propertyfile>
src/main/resources/database.properties
</propertyfile>
<outputfilename>db-scheme.sql</outputfilename>
<export>false</export>
</componentProperties>
</configuration>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.5.Final</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
</dependencies>
</plugin>
src/main/resources/database.properties
:
hibernate.formatSql=true
hibernate.hbm2ddl.auto=validate
# needed for hibernate3-maven-plugin
hibernate.dialect=org.hibernate.dialect.HSQLDialect
src/main/resources/META-INF/persistence.xml
:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="DefaultPersistenceUnit" transaction-type="RESOURCE_LOCAL" />
</persistence>
HTH