Repository navigation
Exclude build-only dependencies from beam-sdks-java-harness jar - #167
Merged
yananhao12 merged 2 commits intoMay 6, 2026
Merged
Conversation
yananhao12
approved these changes
May 6, 2026
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.
Problem
beam-sdks-java-harnesswas bundling build/compile-time only dependencies into its uber jar with no shade relocation, leaking them onto consumer MP classpaths:junit/junit.framework/junit.runner— test framework (6+17+3+2 classes)org.hamcrest— test assertion library (109 classes)org.checkerframework— compile-time annotation only, no runtime behavior (358 classes)io.github.classgraph/nonapi.io— not used in harness main source (122+120 classes)None of these are used in
sdks/java/harness/src/main/java/at runtime (verified via grep).org.checkerframework.@Nullableis used as a compile-time annotation only and is not needed at runtime.Fix
Explicitly exclude these build-only dependencies from the
shadowClosuredependencies block insdks/java/harness/build.gradleso they are not bundled into the fat jar.Verification
Before fix:
jar tf beam-sdks-java-harness-2.45.55-SNAPSHOT.jar | grep -E '^(junit|org/hamcrest|org/checkerframework|io/github/classgraph|nonapi/io)/'returns 700+ classes
After fix:
jar tf beam-sdks-java-harness-2.45.56-SNAPSHOT.jar | grep -E '^(junit|org/hamcrest|org/checkerframework|io/github/classgraph|nonapi/io)/'returns nothing
Changes
sdks/java/harness/build.gradle: excludejunit,hamcrest,checkerframework,classgraphfrom shadow jar bundlingbuildSrc/.../BeamModulePlugin.groovy: bump version to2.45.56gradle.properties: bump version to2.45.56