Skip to content

fix: Add Automatic-Module-Name to MANIFEST.MF for JDK9+ module compatibility #953

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

Merged
merged 5 commits into from
Aug 17, 2022

Conversation

shubha-rajan
Copy link
Contributor

@shubha-rajan shubha-rajan commented Aug 16, 2022

Change Description

This change allows applications that use Java 9+ modules to depend on the socketFactory without having to move to a newer Java version for compilation. See this article for more info on how this works.

Including a jar in the module path where Automatic-Module-Name isn't in the manifest will lead to the module name being derived from the jar file name which, for some of our packages, is an illegal module name because it has a number in it. Renaming the jar file will get it to work, but a better fix is updating the Automatic-Module-Name in the manifest.

For the module name, Let's go with com.google.cloud.sql since that's the prefix for all of our groupIDs, and nobody else at Google uses it. There was a discussion in the Guava PR about how Google packages should handle automatic module names which discusses best practices: google/guava#2846

Relevant issues:

@shubha-rajan shubha-rajan requested review from kurtisvg and a team August 16, 2022 21:21
@@ -104,6 +104,19 @@
<version>2.11.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have the version here. Otherwise you would be compromised with the stability of the release.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.2.2 ?

@shubha-rajan shubha-rajan merged commit 1dfceaf into main Aug 17, 2022
@shubha-rajan shubha-rajan deleted the module-compatibility branch August 17, 2022 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Library is not compatible with java-9 and above (module-info.java)
3 participants