1. 编写Pom.xml文件,内容如下
4.0.0 my.test myHiberante 1.0 myHiberante http://maven.apache.org org.codehaus.mojo hibernate3-maven-plugin 2.2 hbm2java hibernate/java jdbcconfiguration hbm2hbmxml hibernate/hbm jdbcconfiguration model.rev.xml hibernate.properties true false mysql mysql-connector-java 5.0.8 cglib cglib-nodep 2.1_3 mysql mysql-connector-java 5.0.8 log4j log4j 1.2.14-ext compile hbm2java hbm2hbmxml
2. 在本目录下新建以下两个文件:
a. model.rev.xml
b.hibernate.properties
hibernate.dialect = org.hibernate.dialect.MySQLInnoDBDialecthibernate.connection.driver_class = com.mysql.jdbc.Driverhibernate.connection.url = jdbc:mysql://localhost:3306/contacthibernate.connection.username = roothibernate.connection.password= 1hibernate.default_schema = contact
3. 运行maven 命令
mvn hibernate3:hbm2java
4. 得到的生成文件目录
6. 完毕