ShredzoneShred's Bloghttps://shred.zone/tag-Java 1.72018-07-17T20:20:26Z2018-07-17T20:20:26Zhibernate3-maven-plugin fails with Java 1.7Shredhttps://shred.zone/author-1https://shred.zone/page-3522018-07-17T20:20:26Z2012-01-24T00:05:32Z<p>If you're using Maven's <code>hibernate3-maven-plugin</code> for creating a DDL file from your entities, you might encounter the following error when using Java 1.7:</p>
<pre>
Execution default of goal org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl failed:
An AnnotationConfiguration instance is required
</pre>
<p>The reason seems to be a broken JRE detection in the Mojo code, which mistakenly assumes that Java 1.7 does not support annotations. However, I haven't checked that in depth.</p>
<p>The fix is pretty easy. In the plugin configuration of the <code>hibernate3-maven-plugin</code>, add an <code>implementation</code> property to the <code>componentProperties</code> like this:</p>
<pre class="prettyprint"><code class="language-xml"><plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<componentProperties>
<implementation>annotationconfiguration</implementation>
</componentProperties>
</configuration>
</plugin>
</code></pre>
<p>This enforces the use of an <code>AnnotationConfiguration</code> instance.</p>2012-01-24T00:05:32Z