I created a dynamdic web project using Rational Application Developer (RAD) 6.0. The wizard automatically created an EAR project. The EAR project is for creating the Enterprise Archieve (EAR file). I can right click on my EAR project and select export. I can then deploy the single EAR file to my WebSphere server.
The web project uses some third party jar files such as log4j. These utility jars must be deployed with the web application. So I dropped those jar files in my EAR project. From the web project, I right clicked on the web project, select properties.../ Then I select Java Build Path, click on the Libraries tab and then click “Add JARs...”. I can then select any JAR file that is in my workspace. The project file will use relative path to reference the Jar file so that the workspace is portable from one developer to another.
I have some Java code that can be reused in other projects so that I do not want to place them in my web project. I create seperate projects for the code. The projects need to be compiled into Jar files and then packaged into my EAR file. With RAD, there is an easy way to do it. Just click on the Deployment Descriptor of my EAR project, clicke on the Module tab, under Project Utility JARs, click Add to add all my library projects. When I export my EAR file, RAD will automatically create JAR files from my projects and include them in the EAR file.