JPA Hibernate Metamodel generation through maven

前端 未结 1 1148
孤独总比滥情好
孤独总比滥情好 2020-12-28 19:11

I followed the JPA modelgen guide and i was able to generate the canonical metamodel which i need. With this pom set up:


                

        
1条回答
  •  难免孤独
    2020-12-28 19:38

    I'm also using JPA Metamodel generator and I don't have the problems you describe, maybe my configuration can help, I see some differences, the first one is maven-processor-plugin

    
      org.bsc.maven
      maven-processor-plugin
      2.1.0
      
        
          process
          
            process
          
          generate-sources
          
            
              org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
            
          
        
      
      
        
          org.hibernate
          hibernate-jpamodelgen
          
          4.3.4.Final
        
      
    
    

    As you can see I had to add hibernate-jpamodelgen as dependency and the processor attribute.

    I am not sure if build-helper-maven-plugin is necessary to add the directory of generated sources to your source path. I am not using it and it works for me but maybe it's because I am using the default output path for generated sources.

    0 讨论(0)
提交回复
热议问题