Expansion Resource

Generation

Expanders, features and additional expansion steps will be bundled in expansionResources. The ExpansionResource element will be included as an xml in each expanders jar:

<expansionResource name="net.democritus:Expanders">
  <version>4.0.1</version>
  <nsfInstallation undefined="true"/>
  <applicationExpansionSettings undefined="true"/>
  <expanders>...</expanders>
  <features>...</features>
  <additionalExpansionSteps>...</additionalExpansionSteps>
  <expansionResourceDependencys/>
</expansionResource>

This jar can be built automatically by adding the following execution to the build:

<plugins>
  <!-- ... -->
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.6.0</version>
    <executions>
      <execution>
        <phase>generate-resources</phase>
        <goals>
          <goal>java</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <classpathScope>compile</classpathScope>
      <mainClass>net.democritus.expander.setup.ExpansionResourceXmlGenerator</mainClass>
      <arguments>
        <argument>--name</argument>
        <argument>${project.groupId}:${project.artifactId}</argument>
        <argument>--version</argument>
        <argument>${project.version}</argument>

        <argument>--rootDirectory</argument>
        <argument>${project.basedir}/src/main/resources</argument>
        <argument>--targetDirectory</argument>
        <argument>${project.basedir}/src/main/config</argument>
      </arguments>
    </configuration>
  </plugin>
</plugins>

This will generate the expansionResource.xml, which contains lists of the included expanders, features and additional expansion steps.

Usage

In order to add the expanders to your expansion, add the following lines to your expansionSettings file:

<applicationExpansionSettings>
  <!-- ... -->
  <expansionResources>
    <expansionResource name="net.democritus.experimental:testExpanders" version="1.0"/>
  </expansionResources>
</applicationExpansionSettings>

If successful, your expansion folder should contain a file expansion_trace which lists all expanders, features and additional steps including the ones described above.

The same <expansionResources> can be added to nsfInstallation.