Title: Maven builds get an empty okhttp jar · Issue #201 · square/square-java-sdk · GitHub
Open Graph Title: Maven builds get an empty okhttp jar · Issue #201 · square/square-java-sdk
X Title: Maven builds get an empty okhttp jar · Issue #201 · square/square-java-sdk
Description: Using Open Graph Description: Using X Description: Using <dependency> <groupId>com.squareup</groupId> <artifactId>square</artifactId> <version>47.0.1.20260715</version> <scope>compile</scope> &l...
Opengraph URL: https://github.com/square/square-java-sdk/issues/201
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Maven builds get an empty okhttp jar","articleBody":"Using\n```\n\u003cdependency>\n \u003cgroupId>com.squareup\u003c/groupId>\n \u003cartifactId>square\u003c/artifactId>\n \u003cversion>47.0.1.20260715\u003c/version>\n \u003cscope>compile\u003c/scope>\n\u003c/dependency>\n```\n\nThe resulting jar gets an empty okhttp jar. We now need to add\n```\n\u003cdependency>\n \u003cgroupId>com.squareup.okhttp3\u003c/groupId>\n \u003cartifactId>okhttp-jvm\u003c/artifactId>\n \u003cversion>5.2.1\u003c/version>\n\u003c/dependency>\n```\nfor the build to work.\n\n## Some additional detail on the failure and root cause: \n\nSymptom — any Maven-built app using SDK 47.x fails at runtime the first time a client is built:\n```\n java.lang.ClassNotFoundException: okhttp3.Interceptor\n at com.squareup.square.core.ClientOptions.builder(ClientOptions.java:102)\n at com.squareup.square.SquareClientBuilder.buildClientOptions(SquareClientBuilder.java:104)\n at com.squareup.square.SquareClientBuilder.build(SquareClientBuilder.java:255)\n```\n\nRoot cause — the SDK depends on com.squareup.okhttp3:okhttp 5.x, which is published as a Kotlin Multiplatform artifact. The root okhttp jar on Maven Central contains no classes (just META-INF/kotlin-project-structure-metadata.json); the real JVM classes live in okhttp-jvm.\nGradle resolves the redirect via Gradle Module Metadata, but Maven ignores .module files, so Maven consumers silently get the empty jar.\nPer the OkHttp README (https://github.com/square/okhttp#requirements), \"Maven projects must select between okhttp-jvm and okhttp-android\" — see also square/okhttp#8913.\n\nSuggested fix — declare com.squareup.okhttp3:okhttp-jvm in the SDK's published POM so the correct artifact flows transitively to Maven consumers. This is how OpenTelemetry resolved the identical breakage (open-telemetry/opentelemetry-java#7491), and it matches what okio itself does: okio's root POM declares okio-jvm as a plain compile dependency, which is why okio classes resolve fine under Maven while okhttp's don't.\n","author":{"url":"https://github.com/Edwardiv1","@type":"Person","name":"Edwardiv1"},"datePublished":"2026-08-16T04:23:46Z","url":"https://github.com/square/square-java-sdk/issues/201"}
react-profiling 0 react-import-map react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 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:d0c929ed-10f2-52bb-680b-30c8cb51f4d1 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id D0B4:E0CE1:2CBB95C:3B52249:6B057B71 html-safe-nonce 4418f7acd5009a10c996bb7c96a22bdc778c51876152161123ad61c24e8b9b89 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEI0OkUwQ0UxOjJDQkI5NUM6M0I1MjI0OTo2QjA1N0I3MSIsInZpc2l0b3JfaWQiOiI0MzY3OTQxMzEzMzAwMzY0MTQ1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= visitor-hmac ddb4b02121a9865fbddc143ca9e26c2003100c38141b777e1518f46ae2544ed6 hovercard-subject-tag issue:5162699501 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/square/square-java-sdk/201/issue_layout twitter:image https://opengraph.githubassets.com/ba0445423eb785e7975a59202850d7d74b8606ed3adbd484ffcc5dac25e9b8f7/square/square-java-sdk/issues/201 twitter:card summary_large_image og:image https://opengraph.githubassets.com/ba0445423eb785e7975a59202850d7d74b8606ed3adbd484ffcc5dac25e9b8f7/square/square-java-sdk/issues/201 og:image:alt Using og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username Edwardiv1 hostname github.com expected-hostname github.com None 507b2d62524c0f595c35a2a2ee8a6ec54b119f245b3c59eaa070013b70ed1ada turbo-cache-control no-preview go-import github.com/square/square-java-sdk git https://github.com/square/square-java-sdk.git octolytics-dimension-user_id 82592 octolytics-dimension-user_login square octolytics-dimension-repository_id 221058243 octolytics-dimension-repository_nwo square/square-java-sdk octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 221058243 octolytics-dimension-repository_network_root_nwo square/square-java-sdk 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 e7a883ae3b439b8952652eaa7803e2587f30e339 ui-target full theme-color #1e2327 color-scheme light dark react-app-name issues
Response headers:
Server github.com Content-Type text/html; charset=utf-8 Cache-Control max-age=0, private, must-revalidate
URLs of crawlers that visited me.