Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.2
-
Fix Version/s: 3.1
-
Component/s: jpaconfiguration
-
Labels:None
-
Number of attachments :
Description
The hibernate3-maven-plugin works very well in the main project where JPA annotations are used, like this:
<plugin>
<!-- outputs to target/hibernate3/sql/schema.ddl -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>process-test-resources</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
</execution>
</executions>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
</component>
</components>
<componentProperties>
<jdk5>true</jdk5>
<propertyfile>src/main/resources/datasource.properties</propertyfile>
<!-- set this to whatever was set in persistence.xml -->
<persistenceunit>mailPersistence</persistenceunit>
<outputfilename>schema.ddl</outputfilename>
<drop>false</drop>
<create>true</create>
<export>false</export>
<format>true</format>
</componentProperties>
</configuration>
</plugin>
However, I have an "overlay" war build that depends on the former war build, like this:
<build>
<finalName>mailportlet</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>exploded</goal>
</goals>
<configuration>
<webappDirectory>target</webappDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- outputs to target/hibernate3/sql/schema.ddl -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
</execution>
</executions>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
</component>
</components>
<componentProperties>
<jdk5>true</jdk5>
<propertyfile>src/main/resources/datasource.properties</propertyfile>
<!-- set this to whatever was set in persistence.xml -->
<persistenceunit>mailPersistence</persistenceunit>
<outputfilename>schema.ddl</outputfilename>
<drop>false</drop>
<create>true</create>
<export>false</export>
<format>true</format>
</componentProperties>
</configuration>
</plugin>
</plugins>
</build>
Basically what I'm trying to do is to overlay the war (part of which modifies the hibernate.dialect), then explode it so that the Maven 2.x Hibernate Plugin could in-theory access the JPA configuration and the JPA annotated model classes. However, this doesn't work.
Any ideas about how I could accomplish this? It would be great to have an example of this type of usage in the documentation as well, if it is possible, and if it isn't possible, it would be a great enhancement to somehow allow this type of use.
Thanks in advance for any help,
Gary
Activity
Johann Reyes
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 3.0 [ 14874 ] |
Anders Hammar
made changes -
| Fix Version/s | 3.1 [ 18562 ] | |
| Fix Version/s | 3.0 [ 14874 ] |