[build] Relocate shaded jackson and other internal deps in fluss-fs-s3 - #4073
Open
Jackeyzhe wants to merge 1 commit into
Open
[build] Relocate shaded jackson and other internal deps in fluss-fs-s3#4073Jackeyzhe wants to merge 1 commit into
Jackeyzhe wants to merge 1 commit into
Conversation
The fluss-fs-s3 uber-jar bundles hadoop-common and aws-java-sdk dependencies without any shade relocations, leaking 1,114 unshaded jackson class files (jackson-databind, jackson-core, jackson-annotations, jackson-dataformat-cbor) at com/fasterxml/* paths. This can shadow downstream applications' jackson-core and cause NoSuchMethodError at runtime. Fix by adding the same relocation pattern used by fluss-fs-hadoop-shaded: - com.fasterxml -> org.apache.fluss.fs.shaded.s3.com.fasterxml - org.codehaus -> org.apache.fluss.fs.shaded.s3.org.codehaus - com.ctc -> org.apache.fluss.fs.shaded.s3.com.ctc - com.google.re2j -> org.apache.fluss.fs.shaded.s3.com.google.re2j - org.apache.htrace -> org.apache.fluss.fs.shaded.s3.org.apache.htrace Also excludes META-INF/versions/**/com/fasterxml/** because the shade plugin relocates base-path classes but not Multi-Release JAR entries (same issue class as apache#3553). Verified: 0 unshaded com/fasterxml entries (base path and MRJ), 1,093 jackson classes correctly relocated, bytecode references in AWS SDK/Hadoop classes rewritten to the shaded path, intentional jaxb-api MRJ entries preserved. Closes apache#4072
litiliu
reviewed
Aug 24, 2026
| and not used / exposed downstream, mirroring the pattern | ||
| of fluss-fs-hadoop-shaded --> | ||
| <relocation> | ||
| <pattern>com.google.re2j</pattern> |
Contributor
There was a problem hiding this comment.
would it be better to shaded the whole com.google(including re2j and common)?
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.
Purpose
Linked issue: close #4072
The
fluss-fs-s3uber-jar bundleshadoop-commonandaws-java-sdk-*dependencies without any shade relocations, leaking 1,114 unshaded
jackson class files (
jackson-databind,jackson-core,jackson-annotations,jackson-dataformat-cbor) atcom/fasterxml/*paths. These can shadow a downstream application's own jackson-core
(e.g. 2.16+) and cause runtime failures such as
NoSuchMethodError.Brief change log
fluss-filesystems/fluss-fs-s3/pom.xml:packages, namespaced under
org.apache.fluss.fs.shaded.s3.*(mirroring the pattern already used by
fluss-fs-hadoop-shaded):com.fasterxml→org.apache.fluss.fs.shaded.s3.com.fasterxmlorg.codehaus→org.apache.fluss.fs.shaded.s3.org.codehauscom.ctc→org.apache.fluss.fs.shaded.s3.com.ctccom.google.re2j→org.apache.fluss.fs.shaded.s3.com.google.re2jorg.apache.htrace→org.apache.fluss.fs.shaded.s3.org.apache.htrace<filter>excludingMETA-INF/versions/**/com/fasterxml/**:the Maven Shade Plugin relocates base-path classes but not
Multi-Release JAR entries (same issue class as [fluss-client][ fluss-flink-*] Uber-jars leak com.fasterxml.jackson.core alongside the shaded copy #3553, which affected
fluss-shaded-jackson). The relocated base-path implementation issufficient for all Java versions.
Tests
Build-only change (pom.xml), verified by inspecting the produced jar:
unzip -l fluss-fs-s3-*.jar | grep -c " com/fasterxml"→ 1,114 unshaded entries
com/fasterxmlentries (base path and MRJ);1,093 jackson classes correctly relocated to
org/apache/fluss/fs/shaded/s3/com/fasterxml/*rewritten to the shaded path (verified via
javapon sampled classes)jaxb-apiMRJ entries underMETA-INF/versions/**arepreserved untouched
./mvnw spotless:checkpassesAPI and Format
No API or storage format changes. This only affects the internal shading
layout of the
fluss-fs-s3uber-jar; all relocated classes move underthe
org.apache.fluss.fs.shaded.s3namespace.Documentation
No new feature introduced; no documentation changes required.