Share common OSGi bundles for the Liberty profile
We can share common OSGi bundles by placing them in a directory and configuring server.xml for the server, so that those common OSGi bundles are available to your OSGi applications.
- Create a directory in the file system and place all the common OSGi bundles into the directory.
- Add the following lines into server.xml.
<bundleRepository> <fileset dir="directory_path" include="*.jar"/> </bundleRepository>Where directory_path is the path to the directory containing the common OSGi bundles.
- Define a dependency on the common bundle using import phrase in the manifest.mf file of the OSGi application.
Parent topic: Deploy OSGi applications to the Liberty profile