Skip to content
Advertisement

Cannot generate JPA Hibernate Metamodel classes in IntelliJ IDEA

In my Java project, I get “java: cannot find symbol” errors pointing Metamodel classes e.g. Company_.

So, first I checked my-projecttargetgenerated-sourcesannotations and see that it is empty. Then, after several search on the web and SO, I see that the necessary settings seems to be ok and this is the first time I get this problem.

Here is corresponding settings in pom.xml:

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-jpamodelgen</artifactId>
    <version>5.3.7.Final</version>
</dependency>

And I have already had this settings and these have not been changed:

Settings

Settings > Build execution, Deployment > Compiler > Annotation Processors > my-project (selected) :
Enable annotation processing (checked)
Obtain processors from project classpath (selected)
Store generated sources relative to: Module content root
Production sources directory: targetgenerated-sourcesannotations
Test sources directory: targetgenerated-test-sourcestest-annotations

I tried to rebuild project, module, etc. but there is still nothing in my-projecttargetgenerated-sourcesannotations directory. So, how can I generate these JPA Hibernate Metamodel classes in IntelliJ IDEA?

Answer

Try remove .Final from version or just use another version

Advertisement