Eclipselink JPA Maven plugin, supporting static weaving, canonical model generation, and DDL generation.
APACHE-2.0 License
Eclipselink JPA maven plugin made to simplify life of the Eclipselink JPA developer.
modelgen
.persistence.xml
file as the classes are detected automatically and a persistence.xml file is generated.persistence.xml
file already exists, missing <class>...</class>
entries are added automatically. This allows you to have a basic configuration, but you do not have to manually add class entries.Static weaving:
<plugin>
<groupId>com.ethlo.persistence.tools</groupId>
<artifactId>eclipselink-maven-plugin</artifactId>
<version>${eclipselink-maven-plugin.version}</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>weave</goal>
</goals>
</execution>
</executions>
</plugin>
Meta-model generation:
<plugin>
<groupId>com.ethlo.persistence.tools</groupId>
<artifactId>eclipselink-maven-plugin</artifactId>
<version>${eclipselink-maven-plugin.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>modelgen</goal>
</goals>
</execution>
</executions>
</plugin>
Both weave, DDL and meta-model generation and setting basePackages
:
<plugin>
<groupId>com.ethlo.persistence.tools</groupId>
<artifactId>eclipselink-maven-plugin</artifactId>
<version>${eclipselink-maven-plugin.version}</version>
<executions>
<execution>
<id>weave</id>
<phase>process-classes</phase>
<goals>
<goal>weave</goal>
</goals>
</execution>
<execution>
<id>ddl</id>
<phase>process-classes</phase>
<goals>
<goal>ddl</goal>
</goals>
<configuration>
<databaseProductName>mysql</databaseProductName>
</configuration>
</execution>
<execution>
<id>modelgen</id>
<phase>generate-sources</phase>
<goals>
<goal>modelgen</goal>
</goals>
</execution>
</executions>
<configuration>
<basePackages>
<basePackage>org.my.projectA</basePackage>
<basePackage>org.my.projectB</basePackage>
</basePackages>
</configuration>
</plugin>