This plugin uses the JavaCC parser generator to process JavaCC grammar files and generate the appropriate Java source files. For general information about JavaCC, see the JavaCC web site.
JavaCC grammar files use the extension .jj . This plugin can be used to locate and process all grammar files within a specified directory. Java source files will be written to a common generated-sources output directory, typically located in the build output directory. By default, the plugin will run during the generate-sources phase, but it can be configured to run in other phases as well.
The plugin can also be be used to call the JJTree and JTB tools. JJTree is a preprocessor for JavaCC that inserts parse tree building actions at various places in the JavaCC source. More information about JJTree can be found on the JJTree site.
JTB (Java Tree Builder) is another syntax tree builder. Just like JJTree, it works as a preprocessor for JavaCC grammar files and inserts code to build syntax trees from a parsed input stream. More information about JTB in general and a feature comparison with JJTree can be found on the JTB web site.
Finally, this plugin contains a goal for running JJDoc. JJDoc is a simple tool that generates BNF documentation for the JavaCC grammar files. This can be used to generate a report for your project site using the Maven reporting tools.
The following goals are meant to participate in the default build lifecycle:
This last goal is intended for usage with the site lifecycle:
This plugin is normally used before Java compilation, during the generate-sources phase of a build. Detailed instructions on how to use the JavaCC Maven Plugin can be found on the usage page .
To provide you with better understanding of some usages of the JavaCC Plugin, you can take a look into the following examples: