久々にハマったのでメモ
昨日まで普通にビルドできていたのに、gradleのキャッシュクリアしてからgradle buildするとビルドできなくなった。結論からいうとMcafeeのファイアーウォールのせいだった。。
やっていたこと
$ ./gradlew clean build --refresh-dependencies
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/yukiyoshimura/dev/otegalu/backend/build.gradle.kts' line: 1
* What went wrong:
Plugin [id: 'org.springframework.boot', version: '3.3.2'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:3.3.2')
Searched in the following repositories:
Gradle Central Plugin Repository
このようにbuildeでエラーになるが、以下は存在するのになぜnot foundかわからなかった。
Plugin [id: 'org.springframework.boot', version: '3.3.2'] was not found in any of the following sources:
# debugオプションをつけてみる
./gradlew clean build --refresh-dependencies --debug
# 問題の箇所を抜粋
[INFO] [org.apache.http.impl.execchain.RetryExec] I/O exception (java.net.SocketException) caught when processing request to {s}->https://plugins.gradle.org:443: Broken pipe
通信ができていないようだ。
調べた結果、Mcafeeのファイアーウォール設定が原因だった。ファイアーウォールを一旦無効にするとうまくいった。
https://youtrack.jetbrains.com/issue/IDEA-345272/Connection-failed-Broken-pipe.-Please-check-network-connection-and-try-again.
都度ファイアーウォールを無効にするのは手間がかかるのでいい解決方法がわかったら更新する。。