[MSHADE-460] - Preserve multi-release JAR semantics - #831
Open
wilx wants to merge 2 commits into
Open
Conversation
Reproduce record deserialization failure when dependency multi-release semantics are lost. Cover relocation, minimization, and versioned module descriptor handling.
wilx
marked this pull request as ready for review
July 31, 2026 09:47
wilx
force-pushed
the
issue-672-multi-release-manifest
branch
from
July 31, 2026 10:07
f5f54f1 to
20ea8ab
Compare
Propagate the Multi-Release manifest attribute and relocate versioned classes and resources using their logical paths. Keep versioned classes aligned during minimization and discard versioned module descriptors just like root descriptors. Fixes apache#672. Fixes apache#652. Fixes apache#463. Fixes apache#696.
wilx
force-pushed
the
issue-672-multi-release-manifest
branch
from
July 31, 2026 10:14
20ea8ab to
9cb5813
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #672.
Fixes #652.
Fixes #463.
Fixes #696.
Summary
Preserve multi-release JAR semantics when dependencies are incorporated into a
shaded artifact.
The shaded manifest now receives
Multi-Release: truewhen any included inputis a multi-release JAR. An explicit
Multi-Release: falseremains authoritativeand produces a warning explaining that versioned entries will not be active.
Relocation now operates on the logical path below
META-INF/versions/<release>/, so versioned classes and resources remainaligned with their root entries. Minimization likewise treats all physical
versions of a class as the same logical class. Root and versioned
module-info.classentries continue to be discarded; this change does notintroduce module descriptor merging.
Root cause
Shade copied versioned entries but retained only the first input manifest.
This could leave the versioned entries inactive. Relocation also evaluated the
physical
META-INF/versions/<release>/...path, which prevented ordinarypackage relocation rules from matching versioned classes and resources.
Finally, minimization treated a versioned class path as a distinct class name.
Tests
The new integration coverage:
Validation performed with JDK 17:
mvn clean verify— 76 tests passed;mvn -Prun-its clean verify— 86 integration projects passed and oneexisting JRE-gated project was skipped.
Both generated multi-release JARs also pass JDK 21
jar --validateand executesuccessfully on JDK 21.
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[MSHADE-XXX] - Fixes bug in ApproximateQuantiles,where you replace
MSHADE-XXXwith the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean verifyto make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean verify).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.