fix(deps): use okhttp-jvm artifact for okhttp 5.x on Maven#70
Merged
Merged
Conversation
okhttp 5.x split the `okhttp` artifact into JVM/Android variants. The plain `com.squareup.okhttp3:okhttp` jar is now a stub that relies on Gradle Module Metadata to redirect to `okhttp-jvm`. Maven does not read Gradle metadata, so no okhttp3 classes reach the classpath, causing a "package okhttp3 does not exist" compile failure. Depend on `okhttp-jvm` directly to get the classes on Maven. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Environment 承認待ちこの PR のビルドを実行するには、Environment |
book000
approved these changes
Jul 12, 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.
概要
Renovate PR #54 (okhttp
4.12.0→5.4.0) の Maven ビルド失敗 (package okhttp3 does not exist) を解消するための修正です。背景 / 根本原因
okhttp 5.x では
com.squareup.okhttp3:okhttp成果物が JVM / Android バリアントに分割されました。素のokhttpjar は実クラスを含まないスタブ (5.4.0 では 754 バイト、okhttp3クラス 0 個) となり、Gradle Module Metadata (.module) 経由でokhttp-jvmへリダイレクトする仕組みに変わっています。Maven は Gradle Module Metadata を解釈しないため、
okhttpを指定しても実クラスが classpath に載らず、Sender.javaのコンパイルがpackage okhttp3 does not existで失敗します。修正内容
pom.xmlの依存artifactIdをokhttp→okhttp-jvmに変更し、version を5.4.0に更新しました。okhttp-jvm:5.4.0にはokhttp3パッケージの実クラス (329 個) が含まれ、コードが使用する API (RequestBody.create(String, MediaType)、MediaType.get(String)、Request.Builderのurl/header/post/build) はいずれも存在するため、ソースコードの変更は不要です。備考
akubiusa/SystemdLogTracker) からの cross-repo PR です。🤖 Generated with Claude Code