Gradle "Plugin ... was not found in any of the ... repositories"
Gradle could not locate a plugin in any plugin source it searched. The plugin id/version is wrong, or the repository hosting it is not declared in pluginManagement.
What this error means
The build fails while resolving the plugins block with Plugin [id: 'com.example.foo', version: '1.2.3'] was not found in any of the following sources, listing the Gradle Plugin Portal and any declared repos.
* What went wrong:
Plugin [id: 'com.example.foo', version: '1.2.3'] was not found in any of the
following sources:
- Gradle Core Plugins
- Plugin Repositories (could not resolve plugin artifact ...)Common causes
Plugin repository not declared in pluginManagement
Third-party and internal plugins resolve from repositories listed in pluginManagement { repositories {} } in settings. Without the right repo, only the portal is searched.
Wrong plugin id or version
A typo in the plugin id, or a version that was never published, matches nothing on any source.
How to fix it
Declare the plugin repository in settings
Add the hosting repository (and credentials if internal) to pluginManagement.
// settings.gradle.kts
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = uri("https://nexus.example.com/repository/gradle-plugins/") }
}
}Verify the plugin id and version
- Confirm the exact plugin id and a published version on the portal or your registry.
- For a plugin published as a Maven artifact, you may also need a
resolutionStrategymapping id to coordinates. - Run
./gradlew --refresh-dependencies helpto force a fresh plugin lookup.
How to prevent it
- Declare all plugin sources in
pluginManagement, pin plugin versions, and mirror internal plugins so resolution does not depend on the public portal alone.