Setting POM entries for projects that target WebSphere Application Server

Before you begin

Important: Applicable to Liberty, WebSphere® Application Server traditional
Right-click on the pom.xml file and select Open with > Maven POM Editor. Go to the pom.xml tab.

About this task

In addition to the recommended workspace preferences for Maven, you can set several POM entries that generate project structures and class path entries that are best suited for WebSphere Application Server deployments.

Procedure

  1. Set the output folder location. By default, web projects designate output locations that are not nested within the WAR resource folder. This output location breaks the single-root rule for rapid deployment. Specify the source and test output locations as shown in the following example to designate output locations within the resource folder:
    <build>
       <outputDirectory>${project.basedir}\src\main\webapp\WEB-INF\classes</outputDirectory>
       <testOutputDirectory>${project.basedir}\src\main\webapp\WEB-INF\classes</testOutputDirectory>
  2. Set the <finalName> element. By default, Maven uses the version that is designated in the POM as part of the archiveName for both EAR and WAR modules projects. Set <finalName> with a value that equals the project name for both WAR and EAR projects. For example:
    <build>
       <finalName>${project.name}</finalName>
  3. Set the module URI and bundleFileName in the EAR POM. Similar to the <finalName> for stand-alone EAR and WAR archives, the default names for EAR modules are derived from the version information. Designate the settings in the EAR POM file to be consistent with the project name. For example, if the project name was SimpleWeb, use the following settings:
    <modules>
       <webModule>
          <groupId>test</groupId>
          <artifactId>SimpleWeb</artifactId>
          <uri>SimpleWeb.war</uri>
          <bundleFileName>SimpleWeb.war</bundleFileName>
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: pom_entries_for_was.html