Title: Remove dependency annotations from shaded classes by andimarek · Pull Request #4445 · graphql-java/graphql-java · GitHub
Open Graph Title: Remove dependency annotations from shaded classes by andimarek · Pull Request #4445 · graphql-java/graphql-java
X Title: Remove dependency annotations from shaded classes by andimarek · Pull Request #4445 · graphql-java/graphql-java
Description: Summary define an explicit list of unbundled CLASS-retention annotations to remove from shaded class files add an ASM-powered cleanup stage after shadowing and before final JAR assembly preserve invisible annotations whose annotation classes are bundled, including GraphQL Java and relocated dependency annotations reject new RuntimeInvisibleAnnotations and RuntimeInvisibleParameterAnnotations whose annotation classes are not bundled and are not in the removal list share the class-file rewrite machinery with the existing JaCoCo annotation task compile a Java 11 consumer with class-file warnings treated as errors make the annotation-cleaned JAR the sole unclassified binary artifact and the sole main artifact used by consumers, signing, and publication Artifact pipeline The regular jar and shadowJar outputs are internal inputs to the cleanup pipeline. They now have explicit plain and shadow classifiers and live under build/intermediates, outside build/libs. buildFinalJar is the only task that writes the unclassified binary JAR to build/libs. It consumes the annotation-cleaned class tree directly, so Gradle tracks the actual final archive instead of a temporary archive that is renamed in doLast. The Java API and runtime variants both expose buildFinalJar. The Shadow Java variant and assemble hook are disabled, and shadowRuntimeElements is non-consumable, so dependency resolution cannot select the uncleaned intermediate. Direct signing, Maven Local publication, and remote publication all depend on verification of the final JAR. This separation matters because multiple tasks previously owned the same output path. A direct shadowJar invocation could overwrite the cleaned JAR while Gradle still considered the cleanup/reassembly tasks up to date. Unique intermediate paths plus a single final producer remove that failure mode. Verification ./gradlew outgoingVariants: API and runtime variants expose only buildFinalJar; no consumable Shadow variant remains ./gradlew clean test assemble verifyShadedClassAnnotations compileShadedJarConsumer: passed, including 5,737 tests ./gradlew check -x test -x testng: passed isolated publishGraphqlJavaPublicationToMavenLocal: published only the main, sources, Javadoc, and POM artifacts the isolated Maven-local main JAR had the same SHA-256 as the buildFinalJar output direct ./gradlew jar shadowJar invocation left the final JAR SHA-256 unchanged The cleanup currently removes 1,345 annotations from 330 shaded class files. Artifact size Both artifacts were built through their complete publication pipelines with the same fixed 999.0.0-size-test release version. Artifact Size origin/master before removal 3,878,053 bytes This PR after removal 3,873,126 bytes Reduction 4,927 bytes (0.127%) The uncompressed JAR contents decrease by 16,152 bytes. Both archives contain 2,394 entries, and their manifests are identical.
Open Graph Description: Summary define an explicit list of unbundled CLASS-retention annotations to remove from shaded class files add an ASM-powered cleanup stage after shadowing and before final JAR assembly preserve i...
X Description: Summary define an explicit list of unbundled CLASS-retention annotations to remove from shaded class files add an ASM-powered cleanup stage after shadowing and before final JAR assembly preserve i...
Opengraph URL: https://github.com/graphql-java/graphql-java/pull/4445
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e1eb8505-e6ae-ed2f-372a-ffc5f296e852 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E7F2:185F51:E9B5E3:13713DD:6AED46AF |
| html-safe-nonce | 65f14ef6eff981f48e98260e124ae81a2b423e8ddeed2ea0f18d6a26137cfa84 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0YyOjE4NUY1MTpFOUI1RTM6MTM3MTNERDo2QUVENDZBRiIsInZpc2l0b3JfaWQiOiI0MjA5MzEyOTMyNTEzNTMxNTY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0bf7c1f07f222fd87f1e282e17c8c8e085f7d4e812f550006b8c8ee370bb9d42 |
| hovercard-subject-tag | pull_request:4318032096 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/graphql-java/graphql-java/pull/4445/files |
| twitter:image | https://avatars.githubusercontent.com/u/1706744?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1706744?s=400&v=4 |
| og:image:alt | Summary define an explicit list of unbundled CLASS-retention annotations to remove from shaded class files add an ASM-powered cleanup stage after shadowing and before final JAR assembly preserve i... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/graphql-java/graphql-java git https://github.com/graphql-java/graphql-java.git |
| octolytics-dimension-user_id | 14289921 |
| octolytics-dimension-user_login | graphql-java |
| octolytics-dimension-repository_id | 38602457 |
| octolytics-dimension-repository_nwo | graphql-java/graphql-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38602457 |
| octolytics-dimension-repository_network_root_nwo | graphql-java/graphql-java |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width