How to configure maven hbm2hbmxml and hbm2java to run one after the other in mvn clean install

前端 未结 6 1374
一向
一向 2020-12-05 12:37

I need to be able to call mvn clean install and have maven call hibernate3:hbm2hbmxml to generate the mapping files from a database and after than call hbm2java to get the J

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 13:04

    Add Hibernate 2 plugin in your pom:

    
        org.codehaus.mojo
        hibernate3-maven-plugin
        2.2
    
                
                    
                        generate-mapping-files
                        compile
    
                     
                        hbm2hbmxml
                        hbm2cfgxml
                        hbm2java
                    
    ...
    

    Then in model Reveng put this.

    
     
    

    Then just build your project in maven using clean install and the model classes will be generated automatically from the database.

提交回复
热议问题