« prev index next »

6. Code generation


The code generation step is performed by the generate goal of the celerio-maven-plugin, a Maven plugin provided by Jaxio.

The code generation step is driven by several factors:

Source code generation is driven by several

As for database schema extraction, the code generation step does not need to be performed at each build. To prevent useless generation , the simplest approach is to declare a Maven profile dedicated to code generation. As an example you can use the pom.xml that the Celerio bootstrap goal produces.

Details of celerio-maven-plugin

Full name

This plugin uses the metadata.xml file produced by the dbmetadata-maven-plugin:extract-metadata goal.







Simple Usage

In your pom.xml create a dedicated profile to execute the plugin, then run:

mvn -Pgen generate-sources

Here is the gen profile detail:

		<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
		<!-- Generate the code using Celerio -->
		<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
							<id>Generates files using the extracted database schema.</id>

Advanced: Where to generate ?

By default, the files that Celerio generate are rooted in the folder where your pom.xml resides (the Maven ${baseDir} folder).

You can configure it to be a different folder using the ${celerio-maven-plugin.outputDir} expression.

Note The location of a generated file is defined in the generation template relatively to the Celerio outputDir.

The location of the generated Java file depend on the outputDir.

When Celerio outputDir is the same as Maven baseDir, the Java files are generated under:

Whereas when Celerio outputDir is different from Maven baseDir, the Java files are generate under:

© 2005-2015 Jaxio | @jaxiosoft | Legal