Plugin Documentation

Goals available for this plugin:

Goal Description
modello:converters Creates classes that can convert between different versions of the model.
modello:dom4j-reader Creates a DOM4J reader from the model.
modello:dom4j-writer Creates a DOM4J writer from the model.
modello:generate

A dynamic way to use generators and Modello plugins.

Example Usage:

  <plugin>
    <groupId>org.codehaus.modello</groupId>
    <artifactId>modello-maven-plugin</artifactId>
    <version>1.3</version>
    <dependencies>
      <dependency>
        <groupId>org.codehaus.modello</groupId>
        <artifactId>modello-plugin-jpa</artifactId>
        <version>1.0.0-SNAPSHOT</version>
      </dependency>
    </dependencies>
    <configuration>
      <version>1.0.0</version>
      <packageWithVersion>false</packageWithVersion>
      <models>
        <model>src/main/mdo/project-model.xml</model>
      </models>
    </configuration>
    <executions>
      <execution>
        <id>java</id>
        <goals>
          <goal>generate</goal>
        </goals>
        <configuration>
          <generatorId>java</generatorId>
        </configuration>
      </execution>
      <execution>
        <id>jpa</id>
        <goals>
          <goal>generate</goal>
        </goals>
        <configuration>
          <generatorId>jpa-mapping</generatorId>
        </configuration>
      </execution>
    </executions>
  </plugin>
modello:help Display help information on modello-maven-plugin.
Call mvn modello:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
modello:jackson-extended-reader Creates an Jackson extended reader from the model. An extended reader populates the parsed model with metadata about the line/column from which the data was read if the model supports this.
modello:jackson-reader Creates an Jackson reader from the model.
modello:jackson-writer Creates an Jackson writer from the model.
modello:java Creates Java beans from the Modello model.
modello:jdom-writer Creates a jdom writer from the model that is capable of preserving element ordering and comments. In future it should also preserve whitespace.
modello:jsonschema Creates a JSON Schema from the model.
modello:sax-writer Creates a SAX writer from the model.
modello:snakeyaml-extended-reader Creates an Snake Yaml extended reader from the model. An extended reader populates the parsed model with metadata about the line/column from which the data was read if the model supports this.
modello:snakeyaml-reader Creates an SnakeYaml reader from the model.
modello:snakeyaml-writer Creates an SnakeYaml writer from the model.
modello:stax-reader Creates an StAX reader from the model.
modello:stax-writer Creates an StAX writer from the model.
modello:velocity Creates files from the model using Velocity templates.

This mojo can be given a list of templates and a list of parameters. Each template from the templates property will be run with the following context:

  • version: the version of the model to generate
  • model: the modello model
  • Helper: a org.codehaus.modello.plugin.velocity.Helper object instance
  • any additional parameters specified using the params property
The output file is controlled from within the template using the #MODELLO-VELOCITY#SAVE-OUTPUT-TO VTL directive. This allows a single template to generate multiple files. For example, the following directive will redirect further output from the template to a file named org/apache/maven/api/model/Plugin.java if the variable package is set to org.apache.maven.api.model and the variable className is set to Plugin.

#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')/${className}.java}

modello:xdoc Creates documentation for the model in xdoc format.
modello:xpp3-extended-reader Creates an XPP3 extended reader from the model. An extended reader populates the parsed model with metadata about the line/column from which the data was read if the model supports this.
modello:xpp3-extended-writer Creates an XPP3 extended writer from the model. An extended writer renders the content with comments about the line/column from which the data was read if the model supports this.
modello:xpp3-reader Creates an XPP3 reader from the model.
modello:xpp3-writer Creates an XPP3 writer from the model.
modello:xsd Creates an XML schema from the model.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.5.4
JDK 1.8

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.modello</groupId>
          <artifactId>modello-maven-plugin</artifactId>
          <version>2.3.0</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.codehaus.modello</groupId>
        <artifactId>modello-maven-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"