Skip to content

[build] Exclude module-info.class from shaded fat-JARs - #4046

Open
Sekelenao wants to merge 1 commit into
apache:mainfrom
Sekelenao:fix-4045-shade-module-info
Open

[build] Exclude module-info.class from shaded fat-JARs#4046
Sekelenao wants to merge 1 commit into
apache:mainfrom
Sekelenao:fix-4045-shade-module-info

Conversation

@Sekelenao

Copy link
Copy Markdown

Generative AI disclosure

  • Yes (Antigravity)
  • No generative AI tools used

Purpose

Linked issue: close #4045

All shaded uber-JARs (such as fluss-client, fluss-flink-1.20, fluss-server) currently leak META-INF/versions/9/module-info.class from shaded dependencies (like commons-lang3). This causes the Java Platform Module System (JPMS) on Java 9+ to treat these JARs as module org.apache.commons.lang3 rather than deriving an automatic module, breaking downstream modular consumption.

Brief change log

  • In the root pom.xml, configure the global maven-shade-plugin filter (<artifact>*</artifact>) to exclude module-info.class and META-INF/versions/**/module-info.class.

Tests

  • Verified module descriptors with jar --describe-module --file=[jar-path] --release 21 on fluss-client, fluss-flink-1.20, fluss-flink-1.19, and fluss-server (all now correctly derive automatic modules).
  • Ran ./mvnw spotless:check and ./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.

…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
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.

[build] Shaded fat-JARs (fluss-client, fluss-flink, etc.) leak shaded module-info.class, breaking JPMS modular consumption

1 participant