Shared libraries are installed separately and can be used by multiple applications. According to the Java EE specification, the libraries are represented by JAR files. They can reference other shared classes or resources packaged in a separate JAR file or directory, which are included in the same application package, or previously installed in the Java EE containers.
To use shared libraries, you have to deploy them as external applications, and set the appropriate class loader references to these libraries in the application-j2ee-engine.xml of the referencing applications.
Create an Enterprise Application project.
Select the project in the Project Explorer.
In the context menu, choose
.Select the library archives you want to add.
Choose Add JARs to locate JAR files within the Developer Studio workspace.
Choose Add External JARs to locate JAR files outside the Developer Studio.
To use a shared library, set an application-to-application reference in the application-j2ee-engine.xml file of your application.
Example
<application-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="application-j2ee-engine.xsd"> <reference reference-type="hard"> <reference-target provider-name="sap.com" target-type="application">a1</reference-target> </reference> <fail-over-enable mode="disable" xsi:type="fail-over-enableType_disable"/> <start-up mode="manual"/> </application-j2ee-engine>
You are now ready to build and deploy your library component.