./gradlew build で Resolved 'xxx' which is not part of the dependency lock state エラーを ./gradlew resolveAndLockAll --write-locks で解決する

Tadashi Shigeoka ·  Tue, September 27, 2022

./gradlew build で Resolved ‘xxx’ which is not part of the dependency lock state エラーを ./gradlew resolveAndLockAll —write-locks で解決した話をご紹介します。

Gradle | グレイドル

背景 ./gradlew build でエラー発生

./gradlew build で以下のようなエラーが発生して build できなくなりました。

Execution failed for task ':application:bootJarMainClassName'.
> Could not resolve all files for configuration ':application:runtimeClasspath'.
   > Resolved 'software.amazon.awssdk:sesv2:2.17.216' which is not part of the dependency lock state

解決方法 ./gradlew resolveAndLockAll --write-locks

./gradlew resolveAndLockAll --write-locks

? 公式ドキュメント: Generating and updating dependency locks | Gradle 7.5.1

以上、./gradlew build で Resolved ‘xxx’ which is not part of the dependency lock state エラーを ./gradlew resolveAndLockAll —write-locks で解決した、現場からお送りしました。