4.1.3. Using the maven-war-plugin

This approach involves creating an additional Maven module layer, with one extra Maven module of packaging type war for each web application. In each of these extra modules, add a dependency to the original web application artifact.

To adjust configuration files with this approach, the files must be duplicated and maintained like its original. For web applications which support the CoreMedia component approach, it is sufficient to duplicate the WEB-INF/application.properties and add or change properties only within this file. The component approach ensures that properties listed in this file override any other occurrences in other property files.

Libraries that need to be excluded for IBM WebSphere deployment, can only be excluded using the maven-war-plugin and its packagingExcludes configuration element. For a complete description visit the documentation here.

...
  <dependencies>
    <dependency>
      <groupId>com.coremedia.blueprint</groupId>
      <artifactId>content-management-server-webapp</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <packagingExcludes>WEB-INF/lib/foo-bar-*.jar</packagingExcludes>
        </configuration>
      </plugin>
      ...
    </plugins>
  <build>
  ...
          

Example 4.2. Exclude JEE libraries provided by IBM WebSphere


To add libraries, simply add dependencies to the module. An alternative to this method is shared libraries within IBM WebSphere Application Server.