I am using Maven with JPA/Hibernate, and I would like to generate a DDL file to
give to my DBAs. I am using the Hibernate 3 Maven plugin to do this. However,
I keep getting the error "[ERROR] Persistence unit not found: 'myapp'."
Here is the relevant portion of the POM:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
</component>
</components>
<componentProperties>
<create>true</create>
<drop>false</drop>
<export>false</export>
<configurationfile>/target/classes/persistence.xml</configurationfile>
<persistenceunit>myapp</persistenceunit>
<outputfilename>myapp.sql</outputfilename>
<format>true</format>
</componentProperties>
</configuration>
<dependencies>
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.1.0.7.0</version>
</dependency>
</dependencies>
</plugin>
Here is the persistence.xml founf in src/main/resources as well as
target/classes:
<persistence-unit name="myapp" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>MYAPP_DS</jta-data-source>
<properties>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
</properties>
</persistence-unit>
The files are where they are supposed to be, and surely the plugin knows to
look in the target folder for everything. I would appreciate any insight into
what the issue might be.
Thanks.