Usage

Before Starting

Before using, setup your project as described here: Using Sandbox Plugins

How to Use

In the pom.xml, insert this segment.

<project>
...
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>hibernate3-maven-plugin</artifactId>
        <version>2.0-alpha-2</version>
        <configuration>
          <components>
            <component>
              <name>hbm2ddl</name>
              <implementation>jdbcconfiguration</implementation>
            </component>
            <component>
              <name>hbm2hbmxml</name>
              <outputDirectory>src/main/resources</outputDirectory>
            </component>
          </components>
          <componentProperties>
            <drop>true</drop>
            <configurationfile>/src/main/resources/hibernate.cfg.xml</configurationfile>
          </componentProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>
...
</project>

Also you need to add your JDBC driver as an extension describe as follows.

<project>
...
  <build>
    <extensions>
      <extension>
        <groupId>jdbc.artifact.groupid</groupId>
        <artifactId>jdbc-driver</artifactId>
        <version>1.0</version>
      </extension>
    </extensions>
    ...
  </build>
</project>
  • Note: To be able to run the plugin you don't need to add the hibernate jars as dependency in your pom.xml