Skip to content

Place module-info in the root of the jar. - #809

Merged
cpovirk merged 1 commit into
mainfrom
moduleroot
Jul 20, 2026
Merged

cpovirk merged 1 commit into
mainfrom
moduleroot

Conversation

@cpovirk

@cpovirk cpovirk commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

...instead of in a multi-release directory.

Fixes #484

...instead of in a multi-release directory.

Fixes #484

@netdpb netdpb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me, although I'm no expert.

@cpovirk

cpovirk commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks! I continue to invite comment here from anyone more experienced in Gradle than I am. (That is a low bar.) But I am fairly comfortable merging this as it is if no one jumps in.

@cpovirk
cpovirk merged commit 4e80178 into main Jul 20, 2026
14 checks passed
@cpovirk
cpovirk deleted the moduleroot branch July 20, 2026 12:30
copybara-service Bot pushed a commit to google/guava that referenced this pull request Aug 7, 2026
...instead of in a multi-release directory.

We recently [did this for JSpecify](jspecify/jspecify#809) (released in [1.0.1](https://github.com/jspecify/jspecify/releases/tag/v1.0.1)), primarily to avoid [some problems related to `META-INF/versions/9/OSGI-INF/MANIFEST.MF`](jspecify/jspecify#484 (comment)). Granted, the _main_ domain of those problems (but [not only domain](google/error-prone#4971)!) was Android, and `guava-android` isn't ([yet](#7813)?) a module (since we don't include a `module-info.java` file there, even though plenty of module-related configuration is in place), only an "automatic module."

We're also told that [JUnit 5 has done this for years](jspecify/jspecify#484 (comment)) while also supporting Java 8, so that is yet more reason to expect it to be safe.

(This CL is an incremental bonus step in #7094.)

RELNOTES=The Guava `module-info.class` is now present at the root of the jar instead of under [a multi-release root](https://openjdk.org/jeps/238). This prevents the jar from containing a file at `META-INF/versions/9/OSGI-INF/MANIFEST.MF`, which occasionally causes [trouble for some users](jspecify/jspecify#484 (comment)).
PiperOrigin-RevId: 959773233
copybara-service Bot pushed a commit to google/guava that referenced this pull request Aug 7, 2026
...instead of in a multi-release directory.

We recently [did this for JSpecify](jspecify/jspecify#809) (released in [1.0.1](https://github.com/jspecify/jspecify/releases/tag/v1.0.1)), primarily to avoid [some problems related to `META-INF/versions/9/OSGI-INF/MANIFEST.MF`](jspecify/jspecify#484 (comment)). Granted, the _main_ domain of those problems (but [not only domain](google/error-prone#4971)!) was Android, and `guava-android` isn't ([yet](#7813)?) a module (since we don't include a `module-info.java` file there, even though plenty of module-related configuration is in place), only an "automatic module."

We're also told that [JUnit 5 has done this for years](jspecify/jspecify#484 (comment)) while also supporting Java 8, so that is yet more reason to expect it to be safe.

(This CL is an incremental bonus step in #7094.)

RELNOTES=The Guava `module-info.class` is now present at the root of the jar instead of under [a multi-release root](https://openjdk.org/jeps/238). This prevents the jar from containing a file at `META-INF/versions/9/OSGI-INF/MANIFEST.MF`, which occasionally causes [trouble for some users](jspecify/jspecify#484 (comment)).
PiperOrigin-RevId: 960605760
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.

Move module-info back to the main root?

2 participants