Module development structure

A Module is a set of Java, XML and resource files preferably organized in an Eclipse project, before being packaged in a compressed archive (.jmdac). This file can be deployed in user projects and executed in Modelio.

Maven development structure

A Maven Archetype for module developement project is available in the modelio public repository.

          http://repository.modelio.org

          <groupId>org.modelio</groupId>
          <artifactId>modelio-module-archetype</artifactId>
          <version>3.0.1.00</version>

The structure is presented in Illustration 1: Maven Module structure. It is basically an Eclipse Maven project with a conf directory containing all the elements that are specific to the Modelio module and should be packaged with it. The driving files are :

  1. pom.xml: is a Maven build file used to compile and package the module into a jmdac file;
  2. src/main/conf/module.xml: contains all the declarations of Modelio module objects such as the module, profiles, stereotypes, tag and note types, commands and module parameters. Must be valid according to the mdac_module.xsd XSD shema.
  3. src/main/conf/module*.properties which contains the mandatory resources required by the module. It contains mainly the pretty names and the descriptions of the module and module elements (commands, annotations, etc). As a standard Java property file, one file per language is supported.

Beside these files, some directories require comments : * src/main/conf/res: contains the resources of the module elements (icons, etc)


Illustration 1: Maven Module structure

Migration of an Ant development structure to Maven development structure

We now recommend using Maven to compile and package Module development projects. This section describes how to migrate an Ant Module development project to Maven Module development project.

  • Create a new Maven project development using the Modelio Module Archetype available in modelio public repository.
    • Use the same name and version as defined in the Ant project.

  • Copy all files from the old Ant project to the new Maven project.
    • src directory to src/main/java directory.
    • module.xml & module*.properties to src/main/conf directory.
    • resource directory to src/main/conf/res directory.

  • Copy java resource(resource file directly include in source path) to src/main/resources/*/ directory
    • /source/i18n/messages*.properties to src/main/resources/i18n** directory.

  • In module.xml file , replace the values of the module properties name and version by ${project.artifactId} and ${project.version}
1        <module name="${project.artifactId}"
2                version="${project.version}.9015"
3                binaryversion="3.0.00.9015"
4                licenseRequired="false"
5                class="org.modelio.***">

<< Previous Index Next >>

maven_module_structure.png (12.6 KB) admin admin, 19 June 2013 18:39

module_strcture.png (14.5 KB) admin admin, 19 June 2013 18:39