Title: Shaded google dependency points to dangling annotation references · Issue #4436 · graphql-java/graphql-java · GitHub
Open Graph Title: Shaded google dependency points to dangling annotation references · Issue #4436 · graphql-java/graphql-java
X Title: Shaded google dependency points to dangling annotation references · Issue #4436 · graphql-java/graphql-java
Description: Hi team, I have been running Spring for GraphQL tests against GraphQL Java 26.0 for a while now. But as I'm preparing for the next minor version, I am trying to compile the project against 26.0 and getting compiler warnings like this. :s...
Open Graph Description: Hi team, I have been running Spring for GraphQL tests against GraphQL Java 26.0 for a while now. But as I'm preparing for the next minor version, I am trying to compile the project against 26.0 and...
X Description: Hi team, I have been running Spring for GraphQL tests against GraphQL Java 26.0 for a while now. But as I'm preparing for the next minor version, I am trying to compile the project against 26.0...
Opengraph URL: https://github.com/graphql-java/graphql-java/issues/4436
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Shaded google dependency points to dangling annotation references","articleBody":"Hi team,\n\nI have been running Spring for GraphQL tests against GraphQL Java 26.0 for a while now.\nBut as I'm preparing for the next minor version, I am trying to compile the project against 26.0 and getting compiler warnings [like this](https://ge.spring.io/s/gbe5qn2httlk6).\n\n```\n:spring-graphql:compileJava FAILED\t\n/Users/bclozel/.gradle/caches/modules-2/files-2.1/com.graphql-java/graphql-java/26.0/d1a1d3005ca6f4a87b4a985a1907b22bf5b63700/graphql-java-26.0.jar(/graphql/com/google/common/collect/ImmutableList.class): warning: [classfile] Cannot find annotation method 'serializable()' in type 'GwtCompatible': class file for com.google.common.annotations.GwtCompatible not found\t\n/Users/bclozel/.gradle/caches/modules-2/files-2.1/com.graphql-java/graphql-java/26.0/d1a1d3005ca6f4a87b4a985a1907b22bf5b63700/graphql-java-26.0.jar(/graphql/com/google/common/collect/ImmutableList.class): warning: [classfile] Cannot find annotation method 'emulated()' in type 'GwtCompatible'\t\n/Users/bclozel/.gradle/caches/modules-2/files-2.1/com.graphql-java/graphql-java/26.0/d1a1d3005ca6f4a87b4a985a1907b22bf5b63700/graphql-java-26.0.jar(/graphql/com/google/common/collect/ImmutableList.class): warning: [classfile] Cannot find annotation method 'value()' in type 'DoNotCall': class file for com.google.errorprone.annotations.DoNotCall not found\t\n/Users/bclozel/.gradle/caches/modules-2/files-2.1/com.graphql-java/graphql-java/26.0/d1a1d3005ca6f4a87b4a985a1907b22bf5b63700/graphql-java-26.0.jar(/graphql/com/google/common/collect/ImmutableList.class): warning: [classfile] Cannot find annotation method 'value()' in type 'DoNotCall'\t\n/Users/bclozel/.gradle/caches/modules-2/files-2.1/com.graphql-java/graphql-java/26.0/d1a1d3005ca6f4a87b4a985a1907b22bf5b63700/graphql-java-26.0.jar(/graphql/com/google/common/collect/ImmutableList.class): warning: [classfile] Cannot find annotation method 'value()' in type 'DoNotCall'\t\n/Users/bclozel/.gradle/caches/modules-2/files-2.1/com.graphql-java/graphql-java/26.0/d1a1d3005ca6f4a87b4a985a1907b22bf5b63700/graphql-java-26.0.jar(/graphql/com/google/common/collect/ImmutableList.class): warning: [classfile] Cannot find annotation method 'value()' in type 'DoNotCall'\t\n/Users/bclozel/.gradle/caches/modules-2/files-2.1/com.graphql-java/graphql-java/26.0/d1a1d3005ca6f4a87b4a985a1907b22bf5b63700/graphql-java-26.0.jar(/graphql/com/google/common/collect/ImmutableList.class): warning: [classfile] Cannot find annotation method 'value()' in type 'DoNotCall'\t\n/Users/bclozel/.gradle/caches/modules-2/files-2.1/com.graphql-java/graphql-java/26.0/d1a1d3005ca6f4a87b4a985a1907b22bf5b63700/graphql-java-26.0.jar(/graphql/com/google/common/collect/ImmutableList.class): warning: [classfile] Cannot find annotation method 'value()' in type 'DoNotCall'\t\n/Users/bclozel/.gradle/caches/modules-2/files-2.1/com.graphql-java/graphql-java/26.0/d1a1d3005ca6f4a87b4a985a1907b22bf5b63700/graphql-java-26.0.jar(/graphql/com/google/common/collect/ImmutableList.class): warning: [classfile] Cannot find annotation method 'replacement()' in type 'InlineMe': class file for com.google.errorprone.annotations.InlineMe not found\t\nerror: warnings found and -Werror specified\n```\n\nThis is breaking my build since it's compiling with `javac -Xlint:classfile -Werror`\n\n\nIt looks like 26.0 shades relocated Guava classes (like `graphql.com.google.common.collect.ImmutableList`) whose bytecode still carries `RuntimeInvisibleAnnotations` referencing the original relocated annotation\ntypes:\n\n* `com.google.common.annotations.GwtCompatible`\n* `com.google.errorprone.annotations.DoNotCall`\n* `com.google.errorprone.annotations.InlineMe`\n\nThose classes are not present in the jar and this causes the compiler issues.\n\nYou can reproduce this with a minimal build like and run `compileJava`: \n\n```groovy\ndependencies {\n implementation 'com.graphql-java:graphql-java:26.0'\n}\n\ntasks.withType(JavaCompile).configureEach {\n options.compilerArgs += ['-Xlint:classfile', '-Werror']\n}\n```\n\nI can't reproduce this with 25.0, but I'm not sure when/how this was introduced.\nI guess the shadowJar task configuration must be updated to avoid such problems.","author":{"url":"https://github.com/bclozel","@type":"Person","name":"bclozel"},"datePublished":"2026-08-05T19:17:33Z","url":"https://github.com/graphql-java/graphql-java/issues/4436"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a68c4e96-2f95-e245-9206-38dae786e62b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E7E0:24555E:E22706:12D7241:6AED46AA |
| html-safe-nonce | 2ce0dae6e47a068c83c578dd91ad431eb98fe45c10b2b5abb1e7fd9c4e7f12b7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0UwOjI0NTU1RTpFMjI3MDY6MTJENzI0MTo2QUVENDZBQSIsInZpc2l0b3JfaWQiOiIyNDA4ODUyNjAwMzk2NzkzNTE0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 585f85f8e0cfae70395e7cc9eac0b242a9cea61c255a04f8060dadee373b24d4 |
| hovercard-subject-tag | issue:5074404261 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/graphql-java/graphql-java/4436/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c866d8136fd33fa1d54d6c9a56816bcef9578fa94756237f4edf12b33dbe16fa/graphql-java/graphql-java/issues/4436 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c866d8136fd33fa1d54d6c9a56816bcef9578fa94756237f4edf12b33dbe16fa/graphql-java/graphql-java/issues/4436 |
| og:image:alt | Hi team, I have been running Spring for GraphQL tests against GraphQL Java 26.0 for a while now. But as I'm preparing for the next minor version, I am trying to compile the project against 26.0 and... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bclozel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| 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 |
| react-app-name | issues |
Links:
Viewport: width=device-width