[build] Exclude module-info.class from shaded fat-JARs - #4046
Open
Sekelenao wants to merge 1 commit into
Open
Conversation
…nflicts Exclude module-info.class and multi-release module-info.class files from all shaded dependencies in root pom.xml. This prevents third-party module descriptors (e.g. from commons-lang3) from leaking into shaded fat-JARs and breaking JPMS modular consumption. Fixes apache#4045
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.
Generative AI disclosure
Purpose
Linked issue: close #4045
All shaded uber-JARs (such as
fluss-client,fluss-flink-1.20,fluss-server) currently leakMETA-INF/versions/9/module-info.classfrom shaded dependencies (likecommons-lang3). This causes the Java Platform Module System (JPMS) on Java 9+ to treat these JARs as moduleorg.apache.commons.lang3rather than deriving an automatic module, breaking downstream modular consumption.Brief change log
pom.xml, configure the globalmaven-shade-pluginfilter (<artifact>*</artifact>) to excludemodule-info.classandMETA-INF/versions/**/module-info.class.Tests
jar --describe-module --file=[jar-path] --release 21onfluss-client,fluss-flink-1.20,fluss-flink-1.19, andfluss-server(all now correctly derive automatic modules)../mvnw spotless:checkand./mvnw checkstyle:check(all passed cleanly).API and Format
Does not affect API or storage format.
Documentation
Does not introduce new features or require documentation changes.