I am familiar with Import-Package and Export-Package, but this is a new one for me. What does it do?
I am familiar with Import-Package and Export-Package , but this is a new one
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
At runtime in the OSGi container it does nothing. In fact, it’s not even mentioned in the OSGi specification (I checked R4).
However, it can be specified in a
.bndfile for use by bnd at build time. If so, it can be used to determine what goes into the bundle.When bnd builds a bundle, it automatically determines which classes need to go into the bundle. All the classes in packages that are exported are included, and all the classes that they depend on (transitively) are included too. This means that if a class doesn’t appear to be used, then it won’t be included in the bundle. However, you can use the Private-Package instruction to tell bnd to include the contents of the package in the bundle, even if it appears to be unused. If the Private-Package instruction is not specified, then it will be automatically generated by bnd.
The documentation for Private-Package reads as follows: