Usage

Some brief examples on how to use this plugin.

Using the JOMC Plugin in a multi-module build.

If you need to perform object management and configuration tasks in a multi-module build, just configure the JOMC Plugin in your parent pom.xml for performing the various tasks in theire corresponding phases.

<project>
  ...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.jomc</groupId>
        <artifactId>maven-jomc-plugin</artifactId>
        <version>1.9</version>
        <executions>
          <execution>
            <id>default-main</id>
            <goals>
              <goal>attach-main-module</goal>
              <goal>manage-main-sources</goal>
              <goal>commit-main-classes</goal>
              <goal>validate-main-classes</goal>
            </goals>
          </execution>
          <execution>
            <id>default-test</id>
            <goals>
              <goal>attach-test-module</goal>
              <goal>manage-test-sources</goal>
              <goal>commit-test-classes</goal>
              <goal>validate-test-classes</goal>
              <goal>validate-test-model</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

If your classes should be backed by Java resource bundles instead, just add two additional goals and specify a different template profile.

<project>
  ...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.jomc</groupId>
        <artifactId>maven-jomc-plugin</artifactId>
        <version>1.9</version>
        <executions>
          <execution>
            <id>default-main</id>
            <goals>
              <goal>attach-main-module</goal>
              <goal>write-main-resources</goal>
              <goal>manage-main-sources</goal>
              <goal>commit-main-classes</goal>
              <goal>validate-main-classes</goal>
            </goals>
            <configuration>
              <templateProfile>jomc-java-bundles</templateProfile>
            </configuration>
          </execution>
          <execution>
            <id>default-test</id>
            <goals>
              <goal>attach-test-module</goal>
              <goal>write-test-resources</goal>
              <goal>manage-test-sources</goal>
              <goal>commit-test-classes</goal>
              <goal>validate-test-classes</goal>
              <goal>validate-test-model</goal>
            </goals>
            <configuration>
              <templateProfile>jomc-java-bundles</templateProfile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

How to disable resource file processing

mvn ... -Djomc.resourceProcessing=false

How to disable source file processing

mvn ... -Djomc.sourceProcessing=false

How to disable class file processing

mvn ... -Djomc.classProcessing=false

How to skip tests

mvn ... -Dmaven.test.skip=true -Djomc.classProcessing=false

For full documentation, please see the respective goal documentation.