[MSHADE-265] - Add module-info merging support - #829
Open
wilx wants to merge 1 commit into
Open
Conversation
wilx
marked this pull request as ready for review
July 30, 2026 18:24
wilx
force-pushed
the
issue-629-module-info-merging
branch
2 times, most recently
from
July 30, 2026 19:38
6cbc929 to
38ac043
Compare
wilx
marked this pull request as draft
July 30, 2026 20:39
wilx
force-pushed
the
issue-629-module-info-merging
branch
4 times, most recently
from
July 30, 2026 22:25
90dc6e4 to
4cb31a5
Compare
wilx
marked this pull request as ready for review
July 30, 2026 22:29
wilx
force-pushed
the
issue-629-module-info-merging
branch
from
July 31, 2026 12:05
4cb31a5 to
ea84628
Compare
Add opt-in merging for root and multi-release module descriptors while preserving the primary module boundary. Cover relocation, services, modular-floor handling, filtering failures, Maven 3/4 compatibility, and reactor output directories during manifest processing. Fixes apache#629. Fixes apache#581. Fixes apache#588.
wilx
force-pushed
the
issue-629-module-info-merging
branch
from
July 31, 2026 12:47
ea84628 to
82abdc8
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.
Summary
Add opt-in merging of Java module descriptors with:
The default remains
discard, preserving the plugin's existing behavior.The merge follows a source-amalgamation model: the primary artifact supplies the
module identity, while the shaded contents are treated as if their sources had
been relocated and compiled into that module. By default, the primary module's
exports and opens remain its public boundary. Users can opt into the effective
boundary of embedded modules or add explicit exports, opens, requirements, and
service uses where source-level intent cannot be inferred safely.
The processor:
requirements that collide with inactive descriptor or filename-derived names;
and materializing retained packages from embedded open modules when boundary
merging is requested;
automatic modules;
actionable guidance when dynamic service use cannot be inferred;
descriptor view used for merging;
ct.symandjmodsfrom a selected JDK,with optional toolchain requirements for release-aware analysis; and
Multi-release inputs are merged as cumulative release views. The implementation
rebuilds
ModulePackages, validates the invariants required of versioned moduledescriptors, and raises the modular floor when a provider or public-boundary
change cannot be represented at an earlier release. Earlier releases then retain
an automatic-module bridge with a stable
Automatic-Module-Name.Manifest processing now also accepts reactor output directories. Maven can expose
a reactor dependency as
target/classeswhen separate lifecycle tasks such aspackage testare requested. The manifest pre-scan reads a directory manifestwhen present, instead of attempting to open the directory as a JAR.
Documentation covers the defaults, public-boundary modes, explicit overrides,
toolchain selection, dynamic service use, and modular-floor behavior.
Fixes #629.
Fixes #581.
Fixes #588.
JIRA: MSHADE-265,
MSHADE-215
Validation
mvn test: 104 tests run, zero failures; one skipped.mvn test: 104 tests run, zero failures; 14 modular-runtime tests skipped.mvn -Prun-its verify: 86 integration projects passed, one skipped by itsJRE-version condition.
module-info-mergeproject passed when the built plugin was runwith Maven 3.6.3, current Maven 3.x, and Maven 4.
MSHADE-215project fails with Shade 3.6.2 and passes with thebranch build under Maven 3.6.3, current Maven 3.x, and Maven 4.
21 JVM and Maven 3.9.16; the branch build completed successfully in the same
environment.
mvn sitepassed.jar --validate,jar --describe-module,and
jdeps --check.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.