title: Hibernate JPA @Generated annotation compile error
body: <p>I'm starting a maven/hibernate project using eclipse, and I'm having an issue with my metamodel classes. </p>
  
  <p>I'm getting a red x for lines dealing with the <code>@Generated</code> annotation:</p>
  
  <pre><code>import javax.annotation.Generated;
  @Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor")
  </code></pre>
  
  <p>I've reviewed <a href="https://docs.jboss.org/hibernate/orm/5.0/topical/html/metamodelgen/MetamodelGenerator.html#_usage_within_the_ide" rel="nofollow noreferrer">the documentation</a> and it describes an option <code>addGeneratedAnnotation</code>:</p>
  
  <pre><code>If set to true the processor will add the @Generated to the generated Java source file. Adding this annotation using JDK 5 will cause a compilation error. In this case set the flag to false. The default for this option is true
  </code></pre>
  
  <p>where do I set that option in eclipse? In the run config? I tried that, doing just a maven compile, but that did not fix it. Which maven goal will generated new metamodel classes. </p>
  
  <p>I'm pretty sure I have the build path and factory path set up right. I am using java 9. </p>
  
  <p>I have my pom.xml file to include the following</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-jpamodelgen&lt;/artifactId&gt;
      &lt;version&gt;5.3.1.Final&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
      &lt;version&gt;5.3.1.Final&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
      &lt;version&gt;5.3.1.Final&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>update</strong></p>
  
  <p>I tried running <code>package</code> and <code>compile</code> in maven, but was getting the version error 52.0/53.0. </p>
  
  <pre><code>has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
  </code></pre>
  
  <p>I was able to resolve by setting compiler level and project facet java level to 1.8. </p>
  
  <p>Is there a way to get this set up with later versions?</p>