Skip to content

deps(java): bump okhttp 4.12.0 -> 5.4.0, and move to the artifact that has the classes - #333

Merged
scttfrdmn merged 3 commits into
mainfrom
deps/okhttp5-jvm-artifact
Aug 4, 2026
Merged

scttfrdmn merged 3 commits into
mainfrom
deps/okhttp5-jvm-artifact

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Replaces #291, which could not be merged as opened. Closes #291.

The bump alone cannot work

com.squareup.okhttp3:okhttp:5.4.0 contains zero .class files. OkHttp 5 went
multiplatform and split the artifact; the JVM classes moved to
com.squareup.okhttp3:okhttp-jvm, which has 330.

$ unzip -l ~/.m2/.../okhttp-5.4.0.jar     | grep -c '\.class'
0
$ unzip -l ~/.m2/.../okhttp-jvm-5.4.0.jar | grep -c '\.class'
330

So #291's version-only change fails src/main with package okhttp3 does not exist. This PR
makes both edits in one commit: okhttp.version 4.12.0 → 5.4.0 and artifactId okhttp →
okhttp-jvm.

Two things that hid the real cause

  • src/test compiles either way. mockwebserver pulls okhttp-jvm in transitively, so the
    classes were already on the test classpath — only compile scope was missing them. A
    test-only run would have looked fine.
  • The error names the package, not the artifact, so the obvious next move is to hunt for
    renamed OkHttp APIs. There are none. No source file changes in this PR, and all 17 tests
    pass unmodified.

Why Dependabot could never fix this itself

Dependabot bumps versions; this release moved the coordinates. The two edits have to land
together or neither is correct — rebasing #291 any number of times would not have produced a
working commit. Worth recognising the next time a major "breaks the build" in a way no upgrade
guide explains.

Verification

$ mvn -B dependency:tree | grep -i okhttp
[INFO] +- com.squareup.okhttp3:okhttp-jvm:jar:5.4.0:compile
[INFO] +- com.squareup.okhttp3:mockwebserver:jar:5.4.0:test
[INFO] |  \- com.squareup.okhttp3:mockwebserver3:jar:5.4.0:test

$ mvn -B test
[INFO] Tests run: 17, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS

Note okhttp-jvm is now at compile scope, where before it appeared only under test.

The mvn -B test CI step added in #327 is what makes this a failing check rather than a silent
breakage — before it, nothing in this repository had ever run Maven, which is how the SDK's four
compile errors shipped in the first place.

@scttfrdmn scttfrdmn added dependencies Dependency updates (Dependabot) java Pull requests that update java code area: sdk Client SDKs (Python, Java, JavaScript) labels Aug 4, 2026
…t has the classes

OkHttp 5 went multiplatform and split the artifact. `com.squareup.okhttp3:okhttp:5.4.0` is a
stub: `unzip -l okhttp-5.4.0.jar | grep -c '\.class'` returns 0. The JVM classes moved to
`com.squareup.okhttp3:okhttp-jvm`, which has 330.

So the version bump alone cannot work — it fails `src/main` with `package okhttp3 does not
exist`, which reads like a sweeping API break rather than a renamed artifact. Two things hid
what was really going on:

  - `src/test` compiles either way. `mockwebserver` depends on `okhttp-jvm` transitively, so
    the classes were already on the test classpath; only `compile` scope was missing them.
  - the error names the package, not the artifact, so the obvious next move is to go looking
    for renamed OkHttp APIs. There are none to find. No source file changes in this commit,
    and all 17 tests pass unmodified.

This is why #291 could never be merged as opened, and why rebasing it would not have helped:
Dependabot bumps versions, and this release moved the coordinates. The two edits have to be in
one commit or neither is correct — which is a shape worth recognising the next time a major
"breaks the build" in a way no upgrade guide explains.

Verified:
  $ unzip -l ~/.m2/.../okhttp-5.4.0.jar     | grep -c '\.class'   ->   0
  $ unzip -l ~/.m2/.../okhttp-jvm-5.4.0.jar | grep -c '\.class'   -> 330
  $ mvn -B dependency:tree | grep -i okhttp
    +- com.squareup.okhttp3:okhttp-jvm:jar:5.4.0:compile
    +- com.squareup.okhttp3:mockwebserver:jar:5.4.0:test
  $ mvn -B test
    Tests run: 17, Failures: 0, Errors: 0, Skipped: 0
    BUILD SUCCESS

The `mvn -B test` CI step added in #327 is what turns this class of breakage into a failing
check instead of a silent one; before it, nothing in this repository had ever run Maven.

Closes #291.
@scttfrdmn
scttfrdmn force-pushed the deps/okhttp5-jvm-artifact branch from 9c63032 to b1274c2 Compare August 4, 2026 01:03
@scttfrdmn

Copy link
Copy Markdown
Owner Author

Rebased onto main (b155ed8) so this is no longer behind the base branch. Single commit, content unchanged — b1274c2 is 9c63032 replayed on the newer base. The intervening commit was #310, a @types/node bump in the JavaScript SDK, which touches nothing this PR does.

Re-verified after the rebase: TestDocumentedLinksResolve and the label-drift test both pass locally, and CI is green across the board.

The substance is unchanged from the description: com.squareup.okhttp3:okhttp:5.4.0 contains zero .class files — OkHttp 5 went multiplatform and moved the JVM classes to okhttp-jvm — so the version bump and the artifactId change belong in one commit or neither is correct. That is why #291 could not be merged as Dependabot opened it, and why Dependabot structurally cannot fix it: it bumps versions, and this release moved the coordinates.

Still not merging this myself. My standing authority covers closing Dependabot PRs, not merging my own replacements.

CHANGELOG conflict only, in two places: #334 added its docs-site and codeql-v4
entries to the same 'Fixed' section this branch adds #291 to, and a reference
link definition adjacent to this branch's. Both sides kept.
@scttfrdmn
scttfrdmn enabled auto-merge (squash) August 4, 2026 03:39
@scttfrdmn
scttfrdmn merged commit c82fbf1 into main Aug 4, 2026
25 checks passed
@scttfrdmn
scttfrdmn deleted the deps/okhttp5-jvm-artifact branch September 20, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sdk Client SDKs (Python, Java, JavaScript) dependencies Dependency updates (Dependabot) java Pull requests that update java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant