Question

I would like to use the Hibernate3 plugin for Maven (developed by Codehaus) but according to the last release date (2009-01-21), it seems that it's not actively supported. I need to use the hbm2ddl tool provided by Hibernate. What do you think?

Where the hbm2ddl tool is provided? I guess this is not the Hibernate3 Maven plugin that includes it, but it is included in the hibernate dependencies?

Thanks

Was it helpful?

Solution

Probably you've found the old plugin's site that ends with 2.2 version. Check this site out: http://mojo.codehaus.org/hibernate3-maven-plugin/

As you can see, there's 3.0 version released 2 months ago. We use it in our project with Hibernate 3.5 and it works pretty well, doing what it is supposed to do.

Hibernate doesn't need to be provided to the plugin (at least directly), because under the cover this stuff uses Hibernate3 Ant Tasks (from hibernate-tools artifact) with Maven AntRun Plugin. So the plugin has a dependency on Hibernate (3.3.2.GA version) itself. As I said however, we use it with Hibernate 3.5 without any problem so far.

OTHER TIPS

If you want to use hbm2ddl for current hibernate (5.+) with better quality generated schema, then please take a look at project:

https://github.com/Devskiller/hbm2ddl-maven-plugin

Simple use case

<build>
    <plugins>
        <plugin>
            <groupId>com.devskiller.hbm2ddl-maven-plugin</groupId>
            <artifactId>hbm2ddl-maven-plugin</artifactId>
            <version>0.9.2</version>
            <extensions>true</extensions> <!-- required to run automatically -->
            <configuration>
                <packages>
                    <package>com.test.model</package>
                </packages>
            </configuration>
        </plugin>
    </plugins>
</build>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top