java
build_error
ai_generated
true
PluginResolutionException: Plugin [id: 'com.github.johnrengelman.shadow', version: '8.1.1'] was not found in any of the following sources: Gradle Core Plugins, Plugin Repositories (could not resolve plugin artifact 'com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:8.1.1')
ID: java/gradle-plugin-not-found
80%Fix Rate
85%Confidence
0Evidence
2024-04-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8+ | active | — | — | — |
Root Cause
The Gradle plugin is not declared in the pluginManagement block or the plugin repository is missing.
generic中文
Gradle 插件未在 pluginManagement 块中声明,或者缺少插件仓库。
Workarounds
-
95% success Add the Gradle Plugin Portal to pluginManagement repositories
pluginManagement { repositories { gradlePluginPortal() mavenCentral() } } -
90% success Declare the plugin directly in build.gradle with correct version
plugins { id 'com.github.johnrengelman.shadow' version '8.1.1' }
Dead Ends
Common approaches that don't work:
-
Adding the plugin to buildscript dependencies without using pluginManagement
80% fail
Gradle 8+ requires plugins to be resolved via pluginManagement or direct plugin block with repository.
-
Using an older version of the plugin that is not compatible with Gradle 8
75% fail
Version incompatibility leads to resolution failure.