jenkinsci/jenkins · error · IllegalArgumentException
Illegal dependency specifier {0}
Error message
Illegal dependency specifier {0} What it means
IllegalArgumentException thrown by the Dependency constructor when the dependency specifier string does not contain a ':' separator. The expected format is 'shortName:version' (e.g., 'git:4.0.0'). Without a colon, the constructor cannot split the name from the version.
Source
Thrown at core/src/main/java/hudson/PluginWrapper.java:466
@Restricted(NoExternalUse.class) // Jelly use only
public String getHealthScoreClass() {
if (this.healthScore == null) return null;
return getHealthScoreClassForScore(this.healthScore);
}
@ExportedBean
public static final class Dependency {
@Exported
public final String shortName;
@Exported
public final String version;
@Exported
public final boolean optional;
public Dependency(String s) {
int idx = s.indexOf(':');
if (idx == -1)
throw new IllegalArgumentException("Illegal dependency specifier " + s);
this.shortName = Util.intern(s.substring(0, idx));
String version = Util.intern(s.substring(idx + 1));
boolean isOptional = false;
String[] osgiProperties = version.split("[;]");
for (int i = 1; i < osgiProperties.length; i++) {
String osgiProperty = osgiProperties[i].trim();
if (osgiProperty.equalsIgnoreCase("resolution:=optional")) {
isOptional = true;
break;
}
}
this.optional = isOptional;
if (isOptional) {
this.version = osgiProperties[0];
} else {
this.version = version;
}View on GitHub (pinned to 2e228ff40b)
Solutions
- Ensure dependency specifiers use 'shortName:version' format.
- Fix the plugin's POM dependency declarations that generate the manifest.
- Validate dependency strings before constructing Dependency objects.
Example fix
// before
new PluginWrapper.Dependency("git");
// after
new PluginWrapper.Dependency("git:4.0.0"); Defensive patterns
Strategy: validation
Validate before calling
public static boolean isValidDependencySpecifier(String s) {
return s != null && s.indexOf(':') != -1;
} Type guard
public static boolean isValidDependencySpecifier(String s) {
if (s == null || s.isEmpty()) return false;
int idx = s.indexOf(':');
return idx > 0 && idx < s.length() - 1;
} Try / catch
try {
PluginWrapper.Dependency dep = new PluginWrapper.Dependency(spec);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Invalid dependency specifier '" + spec + "'; expected 'name:version'", e);
} Prevention
- Always use 'shortName:version' format for dependency specifiers.
- Validate dependency strings from manifests or config before constructing Dependency objects.
- Ensure build tools (maven-hpi-plugin) generate correct manifest entries.
When it happens
Trigger: Constructing a new PluginWrapper.Dependency from a string that has no ':' character — e.g., 'git', 'git-4.0.0', or an empty string. Typically parsed from plugin manifest dependencies or config.xml.
Common situations: A plugin manifest with a malformed dependency entry, manually edited dependency declarations, or a plugin build tool producing incorrect MANIFEST.MF dependency specifiers.
Related errors
- Plugin installation failed. No manifest at {}
- No such file: {}
- Malformed plugin attribute: {0}
- Failed to parse XML
- Cannot find the plugin instance: {0}
AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14).
Data as JSON: /api/errors/4e4301c8435b9569.
Report an issue: GitHub.