bnd, via the bnd-maven-plugin , is the tool we use to generate the OSGi metadata for our bundles. It is a powerful tool and the reference documentation from https://bnd.bndtools.org/ is comprehensive.

This page documents  how to solve certain problems that occur from time to time in Sling and whose solution is not always obvious.

Inlining a class from a different bundle

Use the -includeresource  instruction pointing to the class file as included in the jar, e.g.

-includeresource:\
  @oak-lucene-*.jar!/org/apache/jackrabbit/oak/plugins/index/lucene/util/LuceneIndexHelper.*


References:

  1. https://github.com/apache/sling-org-apache-sling-jcr-oak-server/blob/org.apache.sling.jcr.oak.server-1.2.10/bnd.bnd
  2. https://bnd.bndtools.org/instructions/includeresource.html
  • No labels