简体   繁体   中英

JPA 2 metamodel not generated

I switched to a new PC where I had to completely set up a new developement environment. I use hibernate tools with Eclipse to generate the object relational model. I wanted to generate the JPA 2 metamodel in Maven using the following guide: https://docs.jboss.org/hibernate/orm/5.0/topical/html/metamodelgen/MetamodelGenerator.html

I followed this guide to the book both in Eclipse AND IntelliJ idea. The metamodel simply does not get generated. No errors. Build succesfull. The target/generated-scources folder remains empty. What I am missing?

I tried ALL the configuration you can find on stackoverflow of the maven pom file but with no success. I digged in the archive and imported the last working iteration of the project, manually deleted the generated sources and tried regenerating the metamodel. Again, no metamodel was generated.

The things that changed in my setup from the last working project:

  • updated Windows from 8.1 to 10
  • updated Java from jdk1.8.0_160 to jdk1.8.0_162
  • updated Eclipse from some version from 2014 to the newest

I am at a loss now. I spent four hours trying stuff out. Any ideas how to proceeed?

I solved it but I do not know what exactly solved it. This is what I did:

  • Reimport the project both in Intellij and Eclipse
  • Reconfigured the annotation processing as outlined in the other solutions
  • Update maven pom meta model generator dependency to newest
  • Remove meta model generator dependency, rebuild project, and add dependency again, rebuild project
  • More tinkering. It was essentially what I have tried before and what is outlined in other solutions.
  • At one time it worked in Eclipse. Don't ask me what did it. I treated this state of my program as "never change this working state". I copied the eclipse metamodel into Intellij, therefore I was able to continue without meta model generation while compiling in Intellij
  • still after failing for hours in Intellij, I waited for one week and suddenly, after changing nothing, it worked!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM