Nice JDev 11g Feature: EAR Packaging
By Olaf Heimburger on Oct 31, 2008
While working on the samples for JDeveloper hands-on workshops and on the ADF in Action series, I stumbled into this nice feature...
EAR Packaging with JDeveloper 11g
In previous releases of JDeveloper a number of different strategies have been used to ensure a proper EAR file packaging. Very common is the usage of Ant or Maven scripts, because these are useful for daily builds.
The JDeveloper IDE has the concept of Applications and Projects, if we translate Application to Enterprise Application and Project to Module, we are right in the Java EE nomenclature and can easily understand how to create an Enterprise Application Archive (EAR) with modules like Web Application (WAR), Enterprise JavaBeans (EJB JAR) and so on. With this background information we are able to locate the necessary deployment profiles for each part of the final application.
Each project has its own deployment profile, eg WAR file for a web application or JAR file for a library project. But if you want to put everything together, where do find it?
The Application Deployment Profile
Exactly, the application itself will hold the deployment profile for the EAR file. To find it we need to go to the Application Properties. Application Properties? Where are they? They are located at the Application Level:
- Open the Application Navigator
- The topmost element is a drop down box with the names of the applications in your IDE. Right next to the drop down box you find the application menu. Click on it and open the Menu. There, at the end of the menu you will find the entry Application Properties! Select it and you will open the Application Properties window.
- Select the Deployment entry to go to the Deployment Profiles overview. On the first time it is empty.
- To create a deployment profile, you must click on the New... button. The Create Deployment Profile window appears and you can select the Archive Type. On this level only the type EAR File is avaiblable and useful.
- Give the profile a Name and click OK.
- Once created you are able to edit the EAR Profile Properties.
Edit the Appliction Deployment Profile
The Edit EAR Deployment Profile Properties window allows you to edit the Application Assembly, ie. which modules, er project results, are part of your EAR file, or the Filter Groups.
Bonus: Locate and Edit the Application Deployment Descriptors
To locate and edit the Application Deployment Descriptors you have to expand the Application Resources accordion in the Application Navigator. The Descriptors group contains all the deployment descriptors used at the EAR level. If you want to add a Java EE or product specific deployment descriptor click on META-INF and open the Context Menu. It will contain the three entries New JEE Deployment Descriptor, New Oracle Deployment Descriptor and New Weblogic Deployment Descriptor. All three open a window to select the specific deployment descriptors from.