The CodeGen Plugin is used to execute auto-generation tools during the Maven build lifecycle, in a phase such as generate-sources
or generate-test-sources
.
The CodeGen Plugin has one goal. The goals are bound to their proper phases within the Maven Lifecycle, and can be automatically executed during their respective phases with the use of <extensions>true</extensions>
in the plugin descriptor.
codegen:radixtree
is bound to thegenerate-sources
phase, and is used to generateRadixTreeEnum
source files.
The codegen:radixtree
goal is bound to the generate-sources
phase, and is used to generate RadixTreeEnum
source files.
To execute the plugin from the command line, the following command can be used:
mvn org.openjax.codegen:codegen-maven-plugin:<goal> -DinFile=<inFile> -DclassName=<className> -DdestDir=[destDir] -DinheritsFrom=[inheritsFrom]
To configure the plugin in your POM, the following is an example of the plugin descriptor:
<plugin>
<groupId>org.openjax.codegen</groupId>
<artifactId>codegen-maven-plugin</artifactId>
<version>0.2.6</version>
<executions>
<execution>
<goals>
<goal>radixtree</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<inFile>src/test/resources/keywords.txt</inFile>
<destDir>${project.build.directory}/generated-sources/radixtree</destDir>
<className>org.example.Keyword</className>
</configuration>
</execution>
</executions>
</plugin>
Configuration | Property | Type | Use | Description |
---|---|---|---|---|
inFile¹ | inFile | String | Required | File containing sorted newline-delimited list of keywords. |
destDir¹ |
destDir |
String |
Optional |
Destination directory of generated enum. Default: ${project.basedir} |
className¹ | className | String | Required | Class name of generated enum. |
inheritsFrom¹ |
inheritsFrom |
String |
Optional |
Interface class name the generated enum must inherit from. Default: null |
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
This project is licensed under the MIT License - see the LICENSE.txt file for details.