Gradle "Plugin ... was not found in any of the following sources" in CI
Gradle looked up a plugin by id in the Gradle Plugin Portal and any configured plugin repositories and found nothing matching. The message lists each source it tried and why it missed.
What this error means
The build fails during plugin resolution with "Plugin [id: 'com.example.foo', version: '1.2'] was not found in any of the following sources:" and a list of Gradle Core, Plugin Portal, and any custom sources.
* What went wrong:
Plugin [id: 'com.example.foo', version: '1.2'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'com.example.foo:com.example.foo.gradle.plugin:1.2')Common causes
A wrong plugin id or version
The id is misspelled or the version was never published to the Plugin Portal, so no marker artifact resolves.
A custom plugin repository is not declared
The plugin is published to a private repository that is not listed under pluginManagement { repositories {} }.
How to fix it
Fix the id and version
- Confirm the exact plugin id and a published version on the Plugin Portal.
- Correct the
plugins {}entry to match. - Re-run so the marker artifact resolves.
plugins {
id("com.example.foo") version "1.4.0"
}Declare the plugin repository
For a private plugin, add its repository in pluginManagement in settings so Gradle searches it.
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = uri("https://maven.internal.example.com/plugins") }
}
}How to prevent it
- Pin plugin versions that are published to the Portal or your repository.
- Declare private plugin repositories in
pluginManagement. - Keep plugin ids in one place so typos are caught in review.