Adding modules to an EAR project
You can add modules that are Maven projects or Maven archives to an EAR project.
About this task
Important: Applicable to Liberty, WebSphere® Application Server traditional
Procedure
- Access the Add dependency dialog. Open the POM editor by double-clicking the pom.xml file. Click the Dependencies tab, then click Add.
- Enter values for the module. Enter the Group Id and Artifact Id of the module that you want to add. Alternatively, you can use the filter field to search for the module.
- Select the module, and click OK.
- Configure the module in the maven-ear-plugin. Click
the pom.xml tab to work directly with the POM
source. Configure the module. The following example shows a configuration
for a web module. For a list of supported modules, see http://maven.apache.org/plugins/maven-ear-plugin/modules.html.
<plugin> <artifactId>maven-ear-plugin</artifactId> <version>2.7</version> <configuration> <version>6</version> <modules> <webModule> <groupId>sample</groupId> <artifactId>webapp</artifactId> <!-- More configuration can be set here --> </webModule> </modules> </configuration> </plugin>
- Save the pom.xml file.
- Update the project. Right-click the EAR project, and select Maven > Update Project. Click OK when you are finished.
- Verify that the module was added to the deployment assembly. Right-click the project and select Properties. Click Deployment Assembly.
- If the EAR has a deployment descriptor file, META-INF/application.xml, verify that the module was added to this file.
Parent topic: Defining Java EE module dependencies

