Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Following standard OSGi R4 syntax, package patterns can include both directives and attributes, which will be copied appropriately into the generated Export-Package manifest header. The version of packages is determined by examining the source JAR file or from packageinfo files in the package directory.

<Private-Package>

The Private-Package header lists the packages that the bundle should contain but not export. The method of inclusion is identical to the Export-Package header, the only difference is, is that these packages are not exported. This header will be copied to the manifest<Private-Package> instruction is similary in every way to the <Export-Package> instruction, except for the fact that these packages will not be exported by the bundle. If a package is selected by noth the export and private package headers, then the export takes precedence.
Private-Package= com.*

<Include-Resource>

The Include<Include-Resource instruction makes it possible to include arbitrary resources; it contains Resource> instruction is a list of resource paths. The resources will arbitrary resources that should be copied into the target jar bundle JAR file. The iclause specified resources can have the following forms:

No Format
 
iclause ::= assignment | inline | simple

...


assignment ::= PATH '=' PATH

...


simple ::= PATH

...


inline ::= '@' PATH

In the case of assignment or simple forms, the PATH parameter can point to a file or directory. The simple form will place the resource in the target bundle JAR with only the file name, i.e., therefore without any path componentscomponent. That isFor example, including src/a/b.c will result in a resource b.c in the root of the target bundle JAR. If the PATH points to a directory, the directory name itself is not used in the target bundle JAR path. If the a resource must be placed in a subdirectory of the target bundle jar, then use the assignment form. The inline requires a ZIP or JAR file, which will be completely expanded in the target bundle JAR.Include-Resource: @osgi.jar,
LICENSE.txt,
acme/Merge.class=src/acme/Merge.class

<Import-Package>

The Import-Package header lists the packages that are required by the contained packages. The default for this header is "*", resulting in importing all referred packages. This header therefore rarely has to be specified. However, in certain cases there is an unwanted import. The import is caused by code that the author knows can never be reached. This import can be removed by using a negating pattern. For example:
Import-Package: !org.apache.commons.log4j

...