Import Module Descriptors

Overview

Many dependencies will be mapped to the same modules in different projects. These standard mappings may be provided by modules files on the class path.

The project config-smartics-jboss-modules provides a configuration to be imported. The next section shows how to import the artifact of this project.

Adding external Module Descriptors

A modules file is located in a folder jboss-modules and attached to the class path like this:

<plugin>
  <groupId>de.smartics.maven.plugin</groupId>
  <artifactId>smartics-jboss-modules-maven-plugin</artifactId>
  <version>0.1.0</version>
  <executions>
    <execution>
      <id>create-modules-archive</id>
      <goals>
        <goal>create-modules-archive</goal>
      </goals>
      <phase>package</phase>
    </execution>
  </executions>
  <dependencies>
    <dependency>
      <groupId>de.smartics.config</groupId>
      <artifactId>config-smartics-jboss-modules</artifactId>
      <version>1.0.0</version>
    </dependency>
  </dependencies>
</plugin>

If the defaultSlot is set, any module without an explicitly specified slot will be mapped to this default slot.

Module Descriptor Format

The content is a list of module elements as shown in Module Section. For instance, the following mapping is stored in a file named jboss-modules/org.apache.commons.xml (extension .xml is required):

<modules xmlns="http://smartics.de/jboss-modules-descriptor">
  <module>
    <name>org.apache.commons.$1</name>
    <includes>
      <include>
        <artifactId>commons-(.*)</artifactId>
      </include>
    </includes>
  </module>
</modules>