Skip to content
Latchkey

Gradle "Plugin [id: ...] was not found" - Fix Plugin Resolution in CI

Gradle could not resolve a plugin you applied. The plugin id is wrong, no version was specified, or the plugin lives in a repository Gradle does not search (the Plugin Portal is the only default).

What this error means

Configuration fails with Plugin [id: 'com.example.foo'] was not found in any of the following sources, listing the plugin repositories it checked. The build never reaches your tasks.

gradle output
* What went wrong:
Plugin [id: 'com.example.custom', version: '1.2.0'] was not found in any of
the following sources:
- Gradle Core Plugins
- Plugin Repositories (could not resolve plugin artifact ...)

Common causes

Plugin not on the Plugin Portal

A third-party or internal plugin not published to the Gradle Plugin Portal is invisible unless you add its repository in pluginManagement.

Wrong id or missing version

A typo in the plugin id, or applying a non-core plugin in the plugins {} block with no version, leaves Gradle unable to resolve it.

How to fix it

Declare the plugin repository in pluginManagement

Tell Gradle where to find non-portal plugins, in settings.gradle.kts.

settings.gradle.kts
// settings.gradle.kts
pluginManagement {
    repositories {
        gradlePluginPortal()
        maven { url = uri("https://nexus.example.com/repository/gradle-plugins/") }
    }
}

Fix the id and pin a version

Use the exact published plugin id and an explicit version in the plugins block.

build.gradle.kts
plugins {
    id("com.example.custom") version "1.2.0"
}

How to prevent it

  • Declare all plugin repositories in pluginManagement in settings.gradle.
  • Pin plugin versions explicitly and use the exact published id.
  • Mirror internal plugins through a single Gradle plugin repository.

Frequently asked questions

What causes ""Plugin [id: ...] was not found""?
A third-party or internal plugin not published to the Gradle Plugin Portal is invisible unless you add its repository in pluginManagement.
How do I fix "Plugin [id: ...] was not found"?
Tell Gradle where to find non-portal plugins, in settings.gradle.kts.

Related guides

References

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