Skip to content

Modeler _modeler_maven_plugin

Antonin Abhervé edited this page Sep 3, 2020 · 1 revision

Modelio Maven Plugin User Guide

The Modelio Maven Plugin allows the Modelio tool to be automated on a specified project, and provides some Modelio module related features.

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

Goal 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>3.0.0.00</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-install\</modelioDir>
          <workspaceDir>H:\modelio-workspace</workspaceDir>
          <projectName>TestProject</projectName>
          <updateBeforeGeneration>true</updateBeforeGeneration>
        </configuration>
      </plugin>
    ...
  </build>
  ...
</project>

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

<project>...
  <build>
    <plugins>
      <plugin>
        <groupId>org.modelio</groupId>
        <artifactId>modelio-maven-plugin</artifactId>
        <version>3.0.0.00</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>
Clone this wiki locally