4.1.2. Using the coremedia-application-maven-plugin

Another approach for configuring artifacts is to use the coremedia-application-maven-plugin. Here you would create an additional Maven module layer similar to the maven-war-plugin approach, but use the ability of the coremedia-application-maven-plugin to define only the property delta you intend to change. For a description of this approach, see Section 4.3.9, “Configure Filtering in the Workspace” in CoreMedia Digital Experience Platform 8 Developer Manual and the plugin documentation here.

You can also use the merge ability to define only a single Maven module for all applications, although not all use cases of the maven-war-plugin scenario can be mapped. Adding or excluding dependencies is not supported. However, adding libraries can be realized using IBM WebSphere shared libraries. Excluding libraries can be achieved using excludes when repackaging the WAR archives afterwards.

...
  <dependencies>
    <dependency>
      <groupId>com.coremedia.blueprint</groupId>
      <artifactId>content-management-server-webapp</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
    ...
  </dependencies>
  <build>
    <plugins>
      <!--
       | to modify properties within an existing property file, create a property
       | file with the properties you want to override below
       | src/main/override-properties.
       | Name the file identical to its target file and place it in a
       | path matching the path within the resulting
       | coremedia-application archive.
       | i.e. the webapps context is cms, you want to change the
       | cap.server.http.port property in the contentserver.properties file and
       | the path to the property file is WEB-INF/properties/corem.
       | Then the contentserver.properties file containing the delta must be
       | placed below src/main/override-properties/webapps/cms plus the path
       | to the properties file mentioned above.
      -->
      <plugin>
        <groupId>com.coremedia.maven</groupId>
        <artifactId>coremedia-application-maven-plugin</artifactId>
        <version>2.7.9</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>assemble-apps</id>
            <goals>
              <goal>package-inplace</goal>
            </goals>
            <configuration>
              <tomcatPath>/</tomcatPath>
              <webapps>
                <webapp>
                  <groupId>com.coremedia.blueprint</groupId>
                  <artifactId>content-management-server-webapp</artifactId>
                  <context>cms</context>
                </webapp>
                ...
              </webapps>
            </configuration
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>default-cli</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <target>
                <war update="true"
                     manifest="${basedir}/src/main/MANIFEST.MF"
                     compress="false"
                     destfile="target/cms.war"
                     basedir="target/${project.build.finalName}/webapps/cms"
                     needxmlfile="false"/>
              </target>
            </configuration>
           </execution>
        </executions>
      </plugin>
      ...
    </plugins>
  </build>
  ...
          

Example 4.1. Create Packages using coremedia-application-maven-plugin