Shared Java projects
There are two options for referencing shared Java classes from a web project:
- Create a single copy of the Java project JAR file in the EAR file. Each WAR file references the JAR file. This approach reduces the size of the EAR file.
- Create a copy of the JAR file in each WAR file. Use this approach if only one WAR file references the JAR file.
EAR-level library
Complete the following steps to place Java source files in a separate project:
Web module library
To create a copy of the JAR file in each WAR file, complete the following steps:
- Right-click the project in the Project view and select Properties.
- Select the Deployment Assembly item from the navigation pane. On the Web Deployment Assembly pane, click Add to include the Java projects or archives you want to reference.
- Click OK to save your changes.