jenkinsci/jenkins · error · IllegalArgumentException

Cannot enable plugin {0} as it is missing the dependency {1}

Error message

Cannot enable plugin {0} as it is missing the dependency {1}

What it means

Error "Cannot enable plugin {0} as it is missing the dependency {1}" thrown in jenkinsci/jenkins.

Source

Thrown at core/src/main/java/hudson/cli/EnablePluginCommand.java:91

        PluginWrapper plugin = manager.getPlugin(shortName);
        if (plugin == null) {
            throw new IllegalArgumentException(Messages.EnablePluginCommand_NoSuchPlugin(shortName));
        }
        if (plugin.isEnabled()) {
            return false;
        }
        stdout.printf("Enabling plugin `%s' (%s)%n", plugin.getShortName(), plugin.getVersion());
        enableDependencies(manager, plugin);
        plugin.enable();
        stdout.printf("Plugin `%s' was enabled.%n", plugin.getShortName());
        return true;
    }

    private void enableDependencies(PluginManager manager, PluginWrapper plugin) throws IOException {
        for (PluginWrapper.Dependency dep : plugin.getDependencies()) {
            PluginWrapper dependency = manager.getPlugin(dep.shortName);
            if (dependency == null) {
                throw new IllegalArgumentException(Messages.EnablePluginCommand_MissingDependencies(plugin.getShortName(), dep));
            }
            if (!dependency.isEnabled()) {
                enableDependencies(manager, dependency);
                stdout.printf("Enabling plugin dependency `%s' (%s) for `%s'%n", dependency.getShortName(), dependency.getVersion(), plugin.getShortName());
                dependency.enable();
            }
        }
    }

}

View on GitHub (pinned to 2e228ff40b)

Solutions

  1. Install and enable the missing dependency plugin first, then retry enable-plugin.
  2. Check Manage Jenkins > Plugins to see the dependency state of the plugin.
  3. Restart Jenkins after enabling dependencies if required.

When it happens

Trigger: Raised when the enable-plugin CLI command targets a plugin whose dependency is missing or disabled, so the plugin cannot be enabled. Install/enable the dependency first.

Common situations: See trigger scenarios.


AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14). Data as JSON: /api/errors/94801017de676c0b. Report an issue: GitHub.