Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

Gradle does not find the Shadow (fat jar) plugin

ErrorGradle stops during configuration because it cannot resolve the plugin id you applied for Shadow

Short answer

Gradle looks the plugin up by exact id and version. Shadow is applied with the id com.gradleup.shadow plus a literal version in the plugins block, and it is resolved from the Gradle Plugin Portal. A different id, a missing version, or a settings file that leaves out gradlePluginPortal() all make Gradle report that the plugin was not found.

  • Applies to Gradle 8.x and 9.x, Shadow 9.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Show the plugin lines in the build file and any pluginManagement block in settings. The id, the version and the repository list are the three things to compare with the causes.

    grep -n -i -E 'shadow|pluginManagement|gradlePluginPortal' build.gradle* settings.gradle*
  2. 2Match what you see, then jump to its fix

    1. 1The id in your plugins block differs from com.gradleup.shadow, or the version is not one the portal listsThe id or version in the plugins block is not what the Shadow docs giveFix
    2. 2settings.gradle(.kts) has a pluginManagement block whose repositories do not include gradlePluginPortal()The Plugin Portal is not among the plugin repositoriesFix
    3. 3The plugin is applied as id("com.gradleup.shadow") with no version, in a project where it is not already on the classpathThe version is missing or computedFix

What does the error look like?

  • Gradle stops during configuration because it cannot resolve the plugin id you applied for Shadow
  • The shadowJar task does not exist after you apply the plugin

Cause 1 of 3

The id or version in the plugins block is not what the Shadow docs give

1Check

The Shadow getting-started page applies the plugin with id com.gradleup.shadow and a version, next to the java plugin. The Plugin Portal page for that id lists the available versions.

grep -n 'shadow' build.gradle*

2Fix

Use the documented id and a version from the portal. The version must be a literal string.

plugins {
    java
    id("com.gradleup.shadow") version "9.6.1"
}

3Verify

Gradle resolves the plugin and lists the shadowJar task.

./gradlew tasks --all | grep -i shadow

Confirmed by gradleup.com

Did this fix it?

Cause 2 of 3

The Plugin Portal is not among the plugin repositories

1Check

By default Gradle searches the Gradle Plugin Portal. A pluginManagement block with repositories replaces that default unless gradlePluginPortal() is listed.

sed -n '1,30p' settings.gradle*

2Fix

Add gradlePluginPortal() to the pluginManagement repositories. pluginManagement must be the first block in settings.gradle(.kts).

pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
}

3Verify

Run any task again.

./gradlew help

Confirmed by docs.gradle.org

Did this fix it?

Cause 3 of 3

The version is missing or computed

1Check

Gradle's plugin documentation says the form without a version is for core plugins or plugins already available to the build script. A plugin that must be resolved needs a version, and the id and version must be constant strings.

grep -rn 'com.gradleup.shadow' --include=*.gradle --include=*.kts .

2Fix

Write the version as a literal, or declare it once in settings under pluginManagement plugins and apply the id alone in modules.

// settings.gradle.kts
pluginManagement {
    plugins {
        id("com.gradleup.shadow") version "9.6.1"
    }
}

3Verify

Sync again and run the jar task.

./gradlew shadowJar

Confirmed by docs.gradle.org

Did this fix it?

How do I stop it coming back?

  • Copy the plugin line from the project's own getting-started page, and take the version from the Plugin Portal.
  • Keep one pluginManagement block in settings so every module resolves plugins the same way.
  • Pin the version; do not use dynamic version strings.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Back end

Gradle runs no Cucumber scenarios from my feature files

Feature files exist under src/test but nothing runs

Cucumber runs on the JUnit Platform, so Gradle must call useJUnitPlatform() and have the cucumber-junit-platform-engine on the test classpath.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.