------ Introduction ------ Rahul Thakur, Mark Struberg ------ November 29, 2010 ------ OpenJPA Maven Plugin As of this writing the OpenJPA Plugin provides 3 goals to cope with persistence-enabled classes in a project using Maven 2. * Goals Overview * <<>> enhances the persistence-enabled classes in a project. * <<>> enhances the persistence-enabled test classes in a project. This is typically bound to the process-test-classes phase. * <<>> creates a file which contains the SQL statements for creating or updating the database or directly create the schema in the database. * <<>> create the schema mapping XML file All these OpenJPA Mojos expect the following resources to be present on classpath: * <<>>, or * <<>> OpenJPA documentation is available {{{http://openjpa.apache.org/documentation.html}here}}. * Examples Below is an OpenJPA plugin configuration example. +----------+ org.apache.openjpa openjpa-maven-plugin 1.2 com/myproject/entities/**/*.class true true directory otherdirectoryvalue enhancer process-classes enhance +-----------+ * You don't have to explicitly specify an OpenJPA dependency in the dependencies section of the plugin! Follow the following guide to use this plugin with {{{examples/older_versions.html}older OpenJPA versions}}. * The <<>> mojo will automatically be called in the <<>> phase. From the command prompt/terminal window. * Change directory to the project's root directory. * Run the following goal to run OpenJPA PCEnhancer on persistence-enabled classes manually. ---------- mvn openjpa:enhance ---------- * Run the following goal to run OpenJPA MappingTool for creating the database creation SQL statements for all persistence-enabled classes manually. ---------- mvn openjpa:sql ---------- * Run the following goal to run OpenJPA MappingTool for creating the schema mapping XML file for all persistence-enabled classes manually. ---------- mvn openjpa:schema ----------