Gradle "Could not resolve all artifacts for configuration" in CI
Gradle failed to download every artifact for a configuration - frequently the :classpath configuration that holds build-script and plugin dependencies. A repository is missing or a coordinate is wrong.
What this error means
Resolution fails with Could not resolve all artifacts for configuration ':classpath' (or another configuration), followed by the specific Could not find/Could not resolve artifact and the locations searched.
* What went wrong:
A problem occurred configuring root project 'app'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.example:build-plugin:1.0.0.Common causes
buildscript repository not declared
Build-script/plugin dependencies resolve from the buildscript { repositories {} } (or pluginManagement) block. If the hosting repo is missing there, the classpath configuration cannot resolve.
Wrong coordinates for a plugin artifact
A typo or a non-existent version of a plugin/build dependency leaves the configuration unresolvable.
How to fix it
Declare the buildscript repository
Add the repo that hosts the build-script dependency to the buildscript block.
buildscript {
repositories {
mavenCentral()
maven { url = uri("https://nexus.example.com/repository/gradle-plugins/") }
}
dependencies {
classpath("com.example:build-plugin:1.0.0")
}
}Identify the unresolved artifact
List the failing configuration to see exactly what is missing and where Gradle searched.
./gradlew buildEnvironment
./gradlew dependencies --configuration classpathHow to prevent it
- Declare buildscript/pluginManagement repositories explicitly, pin plugin/build-dependency versions, and mirror internal plugin artifacts.