Apache MyFaces
Foundation

Plugin documentation

Goals available:

GoalDescription
myfaces-builder:make-client-behaviorsMaven goal to generate java source code for Behavior classes.

It uses velocity to generate templates, and has the option to define custom templates.

The executed template has the following variables available to it:

  • utils : Returns an instance of org.apache.myfaces.buildtools.maven2.plugin.builder.utils.MyfacesUtils, it contains some useful methods.
  • behavior : Returns the current instance of org.apache.myfaces.buildtools.maven2.plugin.builder.model.BehaviorMeta
myfaces-builder:make-convertersMaven goal to generate java source code for Converter classes.

It uses velocity to generate templates, and has the option to define custom templates.

The executed template has the following variables available to it:

  • utils : Returns an instance of org.apache.myfaces.buildtools.maven2.plugin.builder.utils.MyfacesUtils, it contains some useful methods.
  • converter : Returns the current instance of org.apache.myfaces.buildtools.maven2.plugin.builder.model.ConverterMeta
myfaces-builder:make-validatorsMaven goal to generate java source code for Validator classes.

It uses velocity to generate templates, and has the option to define custom templates.

The executed template has the following variables available to it:

  • utils : Returns an instance of org.apache.myfaces.buildtools.maven2.plugin.builder.utils.MyfacesUtils, it contains some useful methods.
  • validator : Returns the current instance of org.apache.myfaces.buildtools.maven2.plugin.builder.model.ValidatorMeta
myfaces-builder:make-validator-tagsMaven goal to generate java source code for Component tag classes.

It uses velocity to generate templates, and has the option to define custom templates.

The executed template has the following variables available to it:

  • utils : Returns an instance of org.apache.myfaces.buildtools.maven2.plugin.builder.utils.MyfacesUtils, it contains some useful methods.
  • validator : Returns the current instance of org.apache.myfaces.buildtools.maven2.plugin.builder.model.ValidatorMeta
myfaces-builder:make-converter-tagsMaven goal to generate java source code for Component tag classes.

It uses velocity to generate templates, and has the option to define custom templates.

The executed template has the following variables available to it:

  • utils : Returns an instance of org.apache.myfaces.buildtools.maven2.plugin.builder.utils.MyfacesUtils, it contains some useful methods.
  • converter : Returns the current instance of org.apache.myfaces.buildtools.maven2.plugin.builder.model.ConverterMeta
myfaces-builder:make-tagsMaven goal to generate java source code for Component tag classes.

It uses velocity to generate templates, and has the option to define custom templates.

The executed template has the following variables available to it:

  • utils : Returns an instance of org.apache.myfaces.buildtools.maven2.plugin.builder.utils.MyfacesUtils, it contains some useful methods.
  • component : Returns the current instance of org.apache.myfaces.buildtools.maven2.plugin.builder.model.ComponentMeta
myfaces-builder:unpackGoal that retrieves a list of artifacts from the repository and unpacks them in a defined location.

This mojo reutilize org.apache.maven.plugin.dependency.fromConfiguration.UnpackMojo from maven-dependency-plugin.

The idea of this plugin, instead just unpack a list of artifacts is add some new features necessary to make easier maintain 1.1 and 1.2 code on myfaces projects like tomahawk.

This plugin works as unpack goal of maven-dependency-plugin with 2 additional enhancements:

  1. If some file exists on the base directories, it is added as excluded, so it is not copied to the output directory. This makes easier to manage the code and maintain it.
  2. If a file is generated from the model (reading the myfaces-metadata.xml) it is not copied, since this should be generated again.
myfaces-builder:build-metadataMaven goal which runs one or more ModelBuilder objects to gather metadata about JSF artifacts into a Model object, then save that model object as an xml file for use by other goals of this plugin.

By default, the generated file is named "META-INF/myfaces-metadata.xml". This file will be included in the final artifact for this project. Having that metadata file embedded in the generated jarfile is useful for two purposes:

  • It is needed if other projects then use the myfaces-builder-plugin to create subclasses of the jsf classes in this project.
  • It is good documentation (more precise than the tld and faces-config.xml files).

Note that the generated file contains all the metadata needed by this project, including a copy of all the metadata from other projects that this one depends on. All other goals of this plugin can execute with just the generated metadata as input, without needing to load other projects. Each entry in the metadata is labelled with a "modelId" property that indicates where it originally came from.

myfaces-builder:make-componentsMaven goal to generate java source code for Component classes.

It uses velocity to generate templates, and has the option to define custom templates.

The executed template has the following variables available to it:

  • utils : Returns an instance of org.apache.myfaces.buildtools.maven2.plugin.builder.utils.MyfacesUtils, it contains some useful methods.
  • component : Returns the current instance of org.apache.myfaces.buildtools.maven2.plugin.builder.model.ComponentMeta
  • innersource : code to be injected from the template class when template mode is used
myfaces-builder:make-configCreates taglib (tld) and faces-config files.

This Mojo actually provides a generic goal that will run a configurable velocity template file and generate a single output file. The template is passed the full metadata model object, and can select from the model whatever data it wants.

The execution can be configured with:

  • The name of the input template to be executed
  • The name of the output file to be created
  • Any number of variables which are accessable from the template (string values only)

The executed template has the following variables available to it:

  • model: the full metadata model for this project
  • modelIds: specifies which items from the model should be processed
  • baseContent: the full text of the contents of the "xmlBaseFile" (if any)
  • utils: an instance of MyfacesUtils that provides static helper methods
  • and whatever (name,value) pairs were configured via the "params" property of this mojo.

myfaces-builder:tagdoc-contentGenerate the tag doc content pages using velocity. This is done before site, because maven-site-plugin use velocity and if we do this inside report generation, we cause a ClassLoader problem.
myfaces-builder:tagdoc-indexReport for generating JSF tagdoc index based on myfaces-metadata.xml parsing. The content is generated using velocity in xdoc files (see TagdocContentMojo).