Fork me on GitHub

OSGi Support

Although neither the JCR specification and nor the FileVault serialization format natively support OSGi bundles and configurations those are still supported to be automatically deployed from a certain repository location through 3rd party modules. This allows to embed them also in content packages so that the full code and content belonging to an OSGi application based on Apache Sling can be wrapped in a single content package.

Bundles and Configurations

Embedding OSGi bundles and configurations is possible in the JCR (and therefore also in FileVault Content Packages). If they follow a certain format and location they can be automatically deployed/extracted into an OSGi feature model with either

  1. Sling OSGi Installer and its JCR Installer Provider or
  2. Sling Content-Package to Feature Model Converter.

For details on the OSGi configuration format refer to Configuration Serialization Formats. Bundles are embedded as simple files (i.e. nt:file nodes).


Although only useful for edge cases (e.g. to install a package only on Sling distributions with a certain run mode) also content packages can be embedded in container packages. The difference to regular sub packages is that those are not installed synchronously along with the container package, but are being picked up asynchronously through the JCR Installer Provider and then being queued for installation through the OSGi installer via its Content Package Installer Factory.

Repository Location

By default the Sling JCR Installer Provider and Sling Content-Package to Feature Model Converter only consider embedded bundles, configurations and packages inside the nodes /libs/../install//apps/../install or /libs/../install//apps/../config optionally suffixed by . followed by one or multiple run modes.

Maven Dependencies

The FileVault Package Maven plugin supports automatically embedding OSGi bundles or packages in the right location in the generated package which are filtered from the project's Maven dependencies through its embeddeds parameter. It needs to be ensured that the embedded target path is set accordingly for the Sling JCR Installer Provider to pick it up.