Fugerit Mars DAO Generation (fj-daogen)
Daogen Maven Plugin (fj-daogen-maven-plugin)
Description :
Allows to include the DAO generation in the maven build lifecycle.
Status :
All basic features are implemented.
Since : fj-doc 1.1.0
Quickstart :
You can find a working example on the sample project, especially the pom.xml file.
Here is sample code to add to the maven configuration file :
<properties>
<!-- the property which will be the base directory for the generation -->
<gen.base.dir>${project.basedir}</gen.base.dir>
<!-- if needed, the folder for generated sources helper files -->
<generated.source.daogen>target/generated-sources/daogen</generated.source.daogen>
</properties>
[...]
<plugin>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-daogen-maven-plugin</artifactId>
<version>${fj-daogens-version}</version>
<executions>
<execution>
<id>daogen</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<daogenConfig>${project.basedir}/src/main/daogen/fugerit-sample-daogen-config.xml</daogenConfig>
<genBaseDir>${gen.base.dir}</genBaseDir>
<!-- if not set, all the sources will be in the default java source folder,
no need to add build-helper-maven-plugin if you do not set this property -->
<generatedSourceHelper>${generated.source.daogen}</generatedSourceHelper>
</configuration>
</plugin>
<!-- setup this plugin only if you set the 'generatedSourceHelper' property -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin-version}</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${gen.base.dir}/${generated.source.daogen}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Documentation :
See : Daogen Maven Plugin Site
especially the daogen:generate.
Backward compatibility :
By default this plugin run on the latest version of fj-daogen-base. It is possible to create compatibility layers for a specific previous version. See for example the project fj-daogen-legacy.