Enhancement with MavenPage edited by Donald Woodsadded more info about the openjpa-maven-pluginUsing the openjpa-maven-pluginThere is a Maven plugin provided by the Codehaus project, which uses OpenJPA to enhance entities during a Maven build. For example, to enhance you source entity classes after they have been compiled (but exclude any POJO classes that rely upon orm.xml maappings), add the openjpa-maven-plugin to the <build> section of your pom.xml, like -
<build>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<includes>**/entities/*.class</includes>
<excludes>**/entities/XML*.class</excludes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<!-- set the version to be the same as the level in your runtime -->
<version>1.2.2</version>
</dependency>
</dependencies>
</plugin>
...
</build>
Change Notification Preferences
View Online
|
View Change
|
Add Comment
|
- [CONF] OpenJPA > Enhancement with Maven confluence
- [CONF] OpenJPA > Enhancement with Maven confluence
