I am trying to set up the Hibernate3 plugin for Maven2. Specifically, I
would like to have the plugin generate POJO's from *.hbm.xml mapping
files.
Relevant portions of my project directory structure:
Hibernate Configuration: <project>/src/main/resources/hibernate.cfg.xml
Hibernate Mappings:
<project>/src/main/resources/com/mycompany/app/*.hbm.xml
Target directory for generated POJO's:
<project>/src/main/java/com/mycompany/app/*.java
POM snippet:
.
.
.
<pluginRepositories>
<pluginRepository>
<id>snapshots</id>
<url>http://snapshots.maven.codehaus.org/maven2</url>
</pluginRepository>
</pluginRepositories>
.
.
.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<configuration>
<hibernate>
<configurationFile>/src/main/resources/hibernate.cfg.xml</configurationF
ile>
</hibernate>
<outputDirectory>
<hbm2java>/src/main/java</hbm2java>
</outputDirectory>
</configuration>
</plugin>
.
.
.
Hibernate configuration snippet:
.
.
.
<mapping resource="com/mycompany/app/TableOne.hbm.xml"/>
<mapping resource="com/mycompany/app/TableTwo.hbm.xml"/>
<mapping
resource="com/mycompany/app/TableThree.hbm.xml"/>
.
.
When I run "mvn hibernate3:hbm2java", I get an error and no POJO's are
generated. The top of my stack trace is:
java.lang.ExceptionInInitializerError
at
org.codehaus.mojo.hibernate3.exporter.Hbm2JavaGeneratorMojo.createExport
er(Hbm2JavaGeneratorMojo.java:52)
Can someone please point out what I'm missing or doing wrong?
Thanks.
This message and any attachments are confidential, proprietary, and may be
privileged. If this message was misdirected, Barclays Global Investors (BGI)
does not waive any confidentiality or privilege. If you are not the intended
recipient, please notify us immediately and destroy the message without
disclosing its contents to anyone. Any distribution, use or copying of this
e-mail or the information it contains by other than an intended recipient is
unauthorized. The views and opinions expressed in this e-mail message are the
author's own and may not reflect the views and opinions of BGI, unless the
author is authorized by BGI to express such views or opinions on its behalf.
All email sent to or from this address is subject to electronic storage and
review by BGI. Although BGI operates anti-virus programs, it does not accept
responsibility for any damage whatsoever caused by viruses being passed.