Creating an Extension Bundle for a 3rd party library.
Paskutinį kartą atnaujinta May 20, 2021 04:53:09 PM GMT
How can we load a 3rd party library that is not an
One option to load a 3rd party library that is not an
OSGi bundle is to create an extension/fragment bundle.
This can be done from the command line as follows. Lets say we have a 3rdparty.jar which contains packages under com.3rdparty.libs that need to be exported.
- Add the jar to the shared classpath of your application server, for example crx-quickstart/server/lib/container under CQSE.
- Create manifest file. For this example we will call it ext.mf. The file have the following contents:
Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.3rdparty.extension Bundle-Version: 1.0 Fragment-Host: system.bundle; extension:=framework Bundle-Name: H2 JDBC Driver Extension Bundle-Description: Bundle exporting com.3rdparty.libs Export-Package: com.3rdparty.libs
Note that the blank line at the end of a jar manifest file is required. Also, all packages you need to export have to be explicitly added to Export-Package as a comma separated list
- Create a jar file with above manifest using the following command.
jar -cfm com.3rdparty.extension-1.0.jar ext.mf
- Install com.3rdparty.extension-1.0.jar using Felix Console or place it in the install folder of your CQ application. This should add org.h2 package to the export list of the System Bundle.
- Please refer to section 3.15, Extension Bundles, of the
OSGiService Platform Core for more information about Extension Bundles.
Prisijunkite prie savo paskyros
Greitos nuorodosPeržiūrėkite visus savo planus Tvarkykite savo planus