Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The latest version of the Bnd Tool has a bug where it combines the Export-Package instructions with the Private-Package instructions:
all.putAll(replaceWitInstruction(getHeader(EXPORT_PACKAGE),
EXPORT_PACKAGE));
all.putAll(replaceWitInstruction(getHeader(PRIVATE_PACKAGE),
PRIVATE_PACKAGE));
this ordering means that any negated packages in Export-Package are erroneously applied to the list of packages in Private-Package.
For example, when you have instructions like the following:
<Export-Package>!org.foo.internal.,org.foo.</Export-Package>
<Private-Package>org.foo.internal.*</Private-Package>
the Bnd Tool will end up excluding the internal packages from the final bundle.
Reversing the statements to be:
all.putAll(replaceWitInstruction(getHeader(PRIVATE_PACKAGE),
PRIVATE_PACKAGE));
all.putAll(replaceWitInstruction(getHeader(EXPORT_PACKAGE),
EXPORT_PACKAGE));
appears to fix the problem, although you could then have problems with negated packages in the Private-Package affecting the Export-Package - but this is less likely.