Usage

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.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>
        <dependencies>
          <dependency>
            <groupId>jdbc.artifact.groupid</groupId>
            <artifactId>jdbc-driver</artifactId>
            <version>1.0</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </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