Open RefuX opened 1 year ago
I don't recall the details of why I didn't add all packages for automatic modules. But I do know the javadoc for ModuleDescriptor.exports states:
If this module is an automatic module then the set of exports is empty.
And that is what is used to generate the OSGi bundle manifest header for exported packages (if the module does not container an OSGi bundle manifest already):
Would you like to try creating a PR that changes that to check for automatic modules? Something like:
if (desc.isAutomatic()) {
desc.packages().stream().sorted().forEach(p -> {
// add p to exportedPackageHeader
});
}
else
{
// do the normal thing
}
I'm trying to reference an automatic module bundle, but can't since it has no exports.
If I look at it in Gogo using the
headers
command:This makes sense from the ModuleLayer API since it states for a ModuleDescriptor:
If this module is an automatic module then the set of exports is empty.
It's a bit confusing since most JPMS information states:
An automatic module implicitly exports all its packages
So any insights on how to use automatic modules will be greatly appreciated.