-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java: Add Automatic-Module-Name entries to the Manifest #6568
Java: Add Automatic-Module-Name entries to the Manifest #6568
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one should go into the release notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @netdpb suggested, the question here is the relation ship between the lite and regular artifacts. If both can reasonably appear in a classpath at the same time this won't work. Anyone know the distinction between these two?
Since lite is mostly for android which doesn't use Java 9+, it might make sense to drop the lite/pom.xml from this PR until we're sure.
At the moment the For example, a regular and a lite runtime with different versions may end up loading a shared class like The worst case would be if a dependency transitively adds the Personally, I'd actually prefer to get a compile time error rather than potentially running into obscure issues at runtime. |
FWIW in Java 9 and later you will get a compile time error if both of these appear in the classpath. |
This PR adds
Automatic-Module-Name
entries to the Manifest files. This allows Java9+ users to depend on protobuf, without having any impact for users of earlier versions.The module names match the OSGI symbolic names as recommended in JLBP-20
This fixes #3903 and #6493