Resolution will not be reattempted
Mavenで過去の解決失敗がキャッシュされ、再試行されない場合のエラー
概要
resolution will not be reattempted は、Mavenが過去に依存関係の解決に失敗した結果をローカルリポジトリにキャッシュし、デフォルトの更新間隔(24時間)が経過するまで再試行しない場合に表示されるエラーです。
エラーメッセージ
[ERROR] Failed to execute goal on project my-app: Could not resolve dependencies:
Could not find artifact com.example:my-library:jar:1.0.0 in central
(https://repo.maven.apache.org/maven2):
Failure to find com.example:my-library:jar:1.0.0 in https://repo.maven.apache.org/maven2
was cached in the local repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced
原因
1. 一時的なネットワーク障害後のキャッシュ
ネットワーク切断時のビルド失敗がキャッシュされ、復旧後もエラーが継続する場合があります。
2. デプロイ前の依存関係参照
まだデプロイされていないアーティファクトを参照してビルドした失敗がキャッシュされている場合です。
3. リポジトリURLの変更後
リポジトリの移行やURL変更があった後、古い失敗情報がキャッシュに残っている場合があります。
解決策
1. 強制更新(-U オプション)
| |
2. .lastUpdated ファイルを削除
| |
3. _remote.repositories ファイルを削除
| |
4. dependency:purge-local-repository を使用
| |
5. 更新間隔を変更
| |
デバッグ方法
| |
関連エラー
関連エラー
Java の他のエラー
この記事は役に立ちましたか?