Java EE deployment assembly

Deployment assembly property pages allow you to add flexible resource and dependency mapping to your applications.

To access the deployment assembly page, right-click your Java™ EE project, and select Properties > Deployment Assembly. For Java EE modules the page consists of two tabs:

In EAR projects, only the Deployment Assembly tab is visible.

The Deployment Assembly tab

The Deployment Assembly table consists of two columns: the Deploy Path column and the Source column.
  • The Deploy Path:

    The Deploy Path column represents the path where the reference is located within the packaged archive. You can modify this location to customize how you want your packaged archive to be organized. However, removing default folder mappings or modifying their deploy paths should be done carefully, since issues with deployment might be encountered if the changes violate the Java EE specification requirements.

  • The Source Column

    The Source column represents the location of the resource relative to the project, the file system, or the workspace, depending on which type of dependency was added.

Adding dependencies

  • Archive from Workspace: If you add an archive from workspace reference, you can then add a reference to an archive file that is inside any project in the workspace. Adding this reference places the chosen archive in the specified deployment path.
  • Archives from File System: If you add an Archive from File System reference, you can then add a reference to an archive file that is anywhere in the file system. Adding this reference places the chosen archive in the specified deployment path.
  • Java Build Path Entries: This option is not available for EAR projects. If you add a Java Build Path Entries reference, you can then add a reference to a Java Build Path Entry that is already defined in your project. You can add references to the following types of Java Build Path Entries.
    • You can add references to loose JAR files that are added to a project classpath directly by the Java Build Path property sheet.
    • You can add references to variables that are defined in the workspace preferences. Access these variables by selecting Window > Preferences > Java > Build Path > Classpath Variables preference page.
    • You can add references to user libraries that are defined in the workspace preferences. Access these libraries by selecting Window > Preferences > Java > Build Path > User Libraries preference page. All archive files that are contained in the library are placed into the specified deployment path. When you add a Java Build Path Entries reference, the deployment path is WEB-INF/lib for Web projects. For other modules that are not web modules, the default deployment path is relative to the parent EAR module. If the parent EAR module is version 5 and above, the deployment path is the lib directory, such as ../lib. If the parent EAR module is version 1.4 or below, the deployment path puts the Java Build Path Entry at the same level as the module, such as ../.
  • Project: If you add a project reference, you can then bundle the chosen workspace project into an archive, and place the archive in the specified deployment path.
  • Folder: If you add a folder reference, you can then select any project folder, and map the folder into a deployment path within the archive. By default, the added folder mappings' deployment paths are set to the root folder of the archive.

The Manifest Entries tab

Java EE classpath management

The Java EE development experience in your workspace simulates the runtime environment closely, reducing the possibility of unforeseen issues that may appear after you publish your application. Each module's MANIFEST file is managed capturing the runtime visibility by duplicating dependent JAR files or other projects on the project classpath. The MANIFEST tab of the deployment assembly captures the existing entries, and allows you to add additional entries within the scope of the parent EAR module. The list of entries available is limited to files of JAR type that reside within the deployed EAR module, and are not included in the designated EAR lib directory. In Java EE 5, the library folder was introduced to EAR modules as a simple technique for sharing JAR files used by other contained modules, but are no longer required to add entries in each respective MANIFEST file. The Deployment Assembly page for EAR projects includes a field for changing the default location of this folder. By default any jar in the /lib folder is shared, and your project classpath will include these JAR files automatically. In addition, the JAR file is not required to physically reside in this folder if a mapping is created from its development location to the EAR file's runtime /lib folder.

Web modules also have a special folder that allows the sharing of libraries under WEB-INF/lib. Similar to the EAR's library folder, any loose JAR file or workspace project mapped to this location will automatically appear on the Web project's classpath.

WebSphere Application Server Loose configuration

The WebSphere® test environment prepares your project for deployment as you are developing, and uses the flat project contents as they are, meanwhile mapping to a standard Java EE runtime structure that WebSphere Application Server can understand. This mapping in WebSphere Application Server is called loose configuration, and allows hot deployment of Java EE applications without the need for special packaging before publish. The new assembly capability allows you to use non-default project layouts, and artifact mappings that might require some packaging at publish time, and could impact publishing performance. In these cases, validation messages warn you of these potential issues. If no messages appear, then your application can run as-is, with no performance penalty.


Feedback