Adding Web library projects
Web library projects allow you to associate Java projects with "virtual" JAR files in a Web project's WEB-INF/lib directory. You can reference JAR files that exist elsewhere in the Enterprise Application project that contains your Web project, if they are in the Web project's build path, and avoid the need to explicitly copy these JAR files into the project's lib folder before you publish the Web application to a server.
Currently, Web Library projects are supported only when testing in the WebSphere test environment or remotely publishing to a WebSphere Application Server. After these associations are made, restart and republish the server for the changes to take effect.
To set up these associations, open the Web perspective and in the Project Explorer view, complete the following steps:
- Expand your project and double-click on the Deployment Descriptor. The Web Deployment Descriptor editor appears.
- In the Overview tab, in the Web Library Projects section, select an existing Java project JAR mapping, or click Add to define a new mapping.
- In the Add a Library Project dialog, supply the JAR name that you want to associate with the current project, and use the Browse button to locate and select the project that contains the JAR file.
- Click Finish
A virtual version of the associated JAR file will appear in the Libraries folder.