By default, plugins in a Gradle plugins block resolve from the public Gradle Plugin Portal. You control that in the settings file with a pluginManagement repositories block, which is separate from the repositories used for your project dependencies. Pin plugin versions in one place so a build never drifts.
Two sets of repositories
Gradle keeps plugin repositories apart from dependency repositories. The docs state that when resolving project dependencies, Gradle uses only the repositories in the build script and ignores the plugin repositories. The reverse is also true: a repository you add for libraries does not supply plugins.
| What you resolve | Where you declare the source | Default |
|---|---|---|
| Libraries your code uses | repositories block, or the centralized settings block | None until you add one |
| Plugins in the plugins block | pluginManagement repositories in settings | Gradle Plugin Portal |
| JDK toolchains | A toolchain resolver plugin | None until configured |
This split surprises teams that lock down library repositories carefully and forget the plugin side. A build plugin runs inside the build with the same reach as your own build scripts, so its source matters at least as much as a library's.
Choosing the source
Add repositories to pluginManagement in settings.gradle.kts. Gradle searches them in the order declared, and if you leave out the portal entry it is not searched at all. A typical internal setup lists only your approved mirror:
pluginManagement {
repositories {
maven {
url = uri("https://repo.example.com/gradle-plugins")
}
}
}
An init script can set the same thing for every build on a machine, which is useful for CI images.
How a plugin is found
For a plugin with an id, Gradle looks for a marker artifact named after the id plus the suffix gradle.plugin, which depends on the real implementation module. This matters for filtering: if you restrict a repository by group, allow the marker group as well as the implementation group, or resolution will fail in a confusing way.
Pin the version in one place
Gradle documents several places to fix a plugin version:
- Inline in the plugins block of a build script, as a constant string.
- Centrally in the plugins section of pluginManagement in settings, where the value can come from gradle.properties.
- In the plugins section of a version catalog, applied with an alias.
Pick one and use it everywhere. The Gradle page on this topic describes exact versions as the way to fix a plugin version, and does not describe ranges, lock files or checksum checks for plugins. Treat that as a gap to close in your own process: review plugin version changes in pull requests the way you review library bumps.
A short review checklist
- List every plugin id in the build, including settings plugins.
- Confirm each resolves from a source you chose.
- Remove plugins nobody can explain.
- Check who maintains each remaining plugin and how often it ships.
- Put plugin version changes under the same review rule as dependency changes.
For the related question of build logic you write yourself, see reviewing convention plugins and buildSrc.
Try it yourself
Click through it at your own pace, or open it full screen.
Step through the pull request and watch what a gate can flag when a version line changes.
Safeguard's policies and gates can block a pull request that changes dependencies against your rules, and the free scan at gold.safeguard.sh/scan shows what a repository pulls in.
Quick check
Does adding a library repository also add a plugin source?
No. Plugin repositories are configured separately in pluginManagement, and project dependency resolution ignores them.
How do I stop Gradle using the Plugin Portal?
Declare your own repositories in pluginManagement and leave out the portal entry. Gradle only searches what is listed.
Sources
Last reviewed: 19 October 2026.