Tuesday, August 26, 2008

More on Maven

Well if you don't really like ant for some reason

Quick Facts

Adding Plugin to Project

Add the following to your POM


Adding Extensions

This is requiered to ensure the correct driver for the databse you are using is available to the plugin. I am using MySQL for example for other databses you have to mention there respective driver jar.









Plugin Goals

  • hibernate3:hbmtemplate Generic exporter that can be controlled by a user provided template or class.
  • hibernate3:hbm2cfgxml Generates hibernate.cfg.xml
  • hibernate3:hbm2dao Base class for the different hibernate3 goals based on the Ant tasks of hibernate tools.
  • hibernate3:hbm2ddl Generates database schema.
  • hibernate3:hbm2doc Generates HTML documentation for the database schema.
  • hibernate3:hbm2hbmxml Generates a set of hbm.xml files.
  • hibernate3:hbm2java Generates Java classes from set of *.hbm.xml files.


Run the following command from command line(ensure you use the complete plugin name)

mvn org.codehaus.mojo:hibernate3-maven-plugin:2.1:hbm2ddl

No comments: