isco isco - 12 days ago 6
Java Question

import package in OSGI

Often I would see something like :

<Import-Package>
package-a,
package-b,
package-c,
*
</Import-Package>


What I don't get is the use of the wild card
*
, why bother specifying
package-a, package-b ...
if at the end we use
*


I think I don't correctly understand the use of the wild card ...

Answer

The wildcard means that Bnd will process the class files included in the bundle for references to types not included in the bundle. Then the necessary packages will be added to the Import-Package header.

Explicitly listing packages can be used when a package is not visible to Bnd's type searching, for example dynamic class loading, or you need specify some attributes on the package.