Skip to content
Latchkey

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.

gradle output
* 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
// settings.gradle.kts
pluginManagement {
    repositories {
        gradlePluginPortal()
        maven { url = uri("https://nexus.example.com/repository/gradle-plugins/") }
    }
}

Verify the plugin id and version

  1. Confirm the exact plugin id and a published version on the portal or your registry.
  2. For a plugin published as a Maven artifact, you may also need a resolutionStrategy mapping id to coordinates.
  3. Run ./gradlew --refresh-dependencies help to 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.

Frequently asked questions

What causes ""Plugin ... was not found""?
Third-party and internal plugins resolve from repositories listed in pluginManagement { repositories {} } in settings. Without the right repo, only the portal is searched.
How do I fix "Plugin ... was not found"?
Add the hosting repository (and credentials if internal) to pluginManagement.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card