I have a Maven-built web-app that uses JPA 2.0 at the back end. The JPA provider is EclipseLink 2.3.2.
When I build the project (and it deploys runs successfully) it bu
After reading @jeqo answer, I tested if, by manually renaming:
"${project.build.directory}/generated-sources/annotations" to ".../generated-sources/hibernate-jpamodelgen"
would make a difference to Nebeans (I'm using v8.2 on ubuntu 16.04).
Everything worked like a charm.
I then modified the pom file as follows:
1) removed the "org.hibernate: hibernate.jpamodelgen" dependency.
2) configured the maven-compiler-plugin as follows:
>org.apache.maven.plugins
maven-compiler-plugin
3.6.1
-proc:none
3) added the following plugin with configuration
org.bsc.maven
maven-processor-plugin
3.2.0
process
process
generate-sources
org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
${project.build.directory}/generated-sources/hibernate-jpamodelgen/
org.hibernate
hibernate-jpamodelgen
5.2.9.Final
This config is directly from the Hibernate JPA Static Metamodel Generator documentation page except for the following line:
${project.build.directory}/generated-sources/hibernate-jpamodelgen/
This line simply generates the metamodel in the directory named after the maven plugin name. From this point, I got all Netbeans references working at design time as if the generated classes were in the src directory subtree.
Hope this helps,
J