Java Reference
In-Depth Information
I MPORT -P ACKAGE
This is a comma-separated list of packages that should be imported into this bundle.
By default, this is also * , which the bnd tool expands into any packages that are refer-
enced from but not contained inside the bundle. Ideally, you should use this header
to tweak the results of the generated list, rather than explicitly list the packages you
want imported. The most important thing to remember is to leave the * at the end of
the header; otherwise, you limit the ability of bnd to manage the set of imported pack-
ages for you:
Import-Package: !org.foo.test,org.foo.runtime,*
P RIVATE -P ACKAGE
This is a comma-separated list of packages that should be included in this bundle but
not exported. This isn't a standard OSG i header, so it won't have any effect at execu-
tion time; it's only used when assembling the bundle. If a package matches both
Export-Package and Private-Package , it will be exported.
I NCLUDE -R ESOURCE
This is a comma-separated list of resource paths to include in this bundle. This isn't a
standard OSG i header, so it won't have any effect at execution time; it's only used
when assembling the bundle. The simplest form of this header doesn't accept any reg-
ular expressions and strips away directories when including resources. The following
example includes two resources, both at the root of the bundle:
Include-Resource: src/foo/plugin.xml, plugin.properties
To p l a c e r e s o u r c e s i n a s u b d i r e c t o r y, y o u m u s t u s e t h e a s s i g n m e n t f o r m . A l l y o u n e e d
to do is put whatever location you want (followed by = ) before the resource:
Include-Resource: META-INF/model=src/model
If you want to preprocess resources and replace any property placeholders ( $... )
with values at build time, put curly braces around the resource clause:
Include-Resource: {META-INF/model=src/model}
Embedding a JAR inside your bundle is as simple as naming it. You don't need to know
its exact location because bnd automatically scans the project class path for it. This
feature is useful when you're using bnd with repository-based build systems like
Maven, where a dependency JAR can come from anywhere:
Include-Resource: foo.jar
If you want to unpack the full JAR instead of embedding it, put an @ at the front:
Include-Resource: @foo.jar
And if you only want certain parts, you can select them using Ant-style path expressions:
Include-Resource: @foo.jar!/**/*.xml
S ERVICE -C OMPONENT
Normally, this header points to an XML resource describing Declarative Service com-
ponents. The bnd tool goes a step further and also accepts inline short descriptions of
Search WWH ::




Custom Search