Creating OSGi bundle projects
An OSGi bundle is a Java™ archive file that contains Java code, resources, and a manifest that describes the bundle and bundle dependencies. An OSGi bundle contains the business logic and metadata that you need to run a service. A bundle is a module in an application, which in turn is deployed to a server.
Procedure
Results
Your OSGi bundle project is created and your bundle manifest
is added to your project.
Important: When
you specify bundle dependencies in your MANIFEST.MF file, use the property
Import-Package
instead of Require-bundle
. If you use Require-bundle
to specify bundle dependencies, your application does not deploy.
Import-Package
is a more flexible way to declare
dependencies:- You can declare dependencies on the functionality that you need rather than on the bundle where the functionality originated, as it does not add unnecessary dependencies on packages that are not required by your bundle but are included in the dependent bundle.
- You can specify versions or version ranges for the declared package, therefore you do not have to react to changes in different versions of the bundle.