JDev 11g: Packaging Libraries at EAR Level

Many users have problems to use their libraries in their applications. But sometimes a working solution is too obvious to be noticed.

To include all the libraries you need for your project in an EAR file:

  1. Create a package project called common-libs and put all the libraries in a directory included in the Project Source Path. Don't use the src directory but lib at the same hierarchy level. Add this new directory to the Project Source Paths.
  2. Open the Application Properties
  3. Create a deployment profile for the EAR file.
  4. To include the libraries within the EAR file we have two options to include the libraries are available: either put into APP-INF/lib or a directory of your choice (eg. lib). In the Deployment Profile select Application Assembly, tick the check box of every JAR file you need and enter the directory name (APP-INF/lib or lib) in the Path in EAR text field at the bottom. This must be done for every JAR file!
  5. If you do not want to use APP_INF/lib you need to create an application.xml for the application. Open the Application Resources accordion and expand Descriptors and META-INF to see which Deployment Descriptors are available. On Descriptors, chose New JEE Deployment Descriptor... from the Context Menu and select application.xml. In the newly created application.xml insert the tag <library-directory>lib</library-directory>.
  6. From the Application Menu select Deploy to EAR File to check the contents before deploying it to the server.


Comments:

Post a Comment:
Comments are closed for this entry.
About

This is my blog for things I found useful during my work as Senior Solution Architect for Identity Management and Service-oriented Architecture at Oracle. All text expressed on this blog is my own opinion and not related to my employer.

Search

Top Tags
Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today