Modelio Maven Plugin User Guide

The Modelio Maven Plugin allows automation of the Modelio tool on a specified project, and provides some Modelio module related conveniences.

The Modelio Maven Plugin gets the parameter values that will be used from the plugin configuration specified in the pom.

Goals Overview

The Modelio MavenPlugin has six goals, divided into two categories:

Usage

The Modelio Maven Plugin uses the Modelio tool. The following examples describe the basic usage of the Plugin.

To update your modelio project from SVN, and then generate the Java sources and Javadoc:


<project>...
  <build>
    <plugins>
      <plugin>
        <groupId>org.modelio</groupId>
        <artifactId>modelio-maven-plugin</artifactId>
        <version>2.2.1.01</version>
        <executions>
          <execution>
            <id>GenerateJavaSources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate-modelio-sources</goal>
            </goals>
          </execution>
          <execution>
            <id>GenerateJavadoc</id>
            <goals>
              <goal>generate-modelio-javadoc</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <modelioDir>H:\modelio-201204261031-win32.win32.x86_64\modelio</modelioDir>
          <workspaceDir>H:\modelio-201204261031-win32.win32.x86_64\modelio\workspace</workspaceDir>
          <projectName>TestProject</projectName>
          <updateBeforeGeneration>true</updateBeforeGeneration>
        </configuration>
      </plugin>
    ...
  </build>
  ...
</project>

In a module development project, fill in and validate the module.xml file:


<project>...
  <build>
    <plugins>
      <plugin>
        <groupId>org.modelio</groupId>
        <artifactId>modelio-maven-plugin</artifactId>
        <version>2.2.1.01</version>
        <executions>
          <execution>
            <id>ModuleValidation</id>
            <phase>validate</phase>
            <goals>
              <goal>module-validation</goal>
            </goals>
          </execution>
          <execution>
            <id>ResourceManagement</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>module-configuration</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <moduleFile>${project.basedir}/src/main/conf/module.xml</moduleFile>
        </configuration>
      </plugin>
    </plugins>
    ...
  </build>
  ...
</project>

Where to find this plugin

In your pom.xml file, add the following code to use the Modelio repository:


<project>
  ...
  <pluginRepositories>
    <pluginRepository>
      <id>modelio</id>
      <url>http://repository.modelio.org</url>
    </pluginRepository>
    ...
  </pluginRepositories>
  ...
</project>