{"record":{"id":"4e4301c8435b9569","repo":"jenkinsci/jenkins","slug":"illegal-dependency-specifier-0","errorCode":null,"errorMessage":"Illegal dependency specifier {0}","messagePattern":"Illegal dependency specifier (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/hudson/PluginWrapper.java","lineNumber":466,"sourceCode":"    @Restricted(NoExternalUse.class) // Jelly use only\n    public String getHealthScoreClass() {\n        if (this.healthScore == null) return null;\n        return getHealthScoreClassForScore(this.healthScore);\n    }\n\n    @ExportedBean\n    public static final class Dependency {\n        @Exported\n        public final String shortName;\n        @Exported\n        public final String version;\n        @Exported\n        public final boolean optional;\n\n        public Dependency(String s) {\n            int idx = s.indexOf(':');\n            if (idx == -1)\n                throw new IllegalArgumentException(\"Illegal dependency specifier \" + s);\n            this.shortName = Util.intern(s.substring(0, idx));\n            String version = Util.intern(s.substring(idx + 1));\n\n            boolean isOptional = false;\n            String[] osgiProperties = version.split(\"[;]\");\n            for (int i = 1; i < osgiProperties.length; i++) {\n                String osgiProperty = osgiProperties[i].trim();\n                if (osgiProperty.equalsIgnoreCase(\"resolution:=optional\")) {\n                    isOptional = true;\n                    break;\n                }\n            }\n            this.optional = isOptional;\n            if (isOptional) {\n                this.version = osgiProperties[0];\n            } else {\n                this.version = version;\n            }","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/PluginWrapper.java#L448-L484","documentation":"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.","triggerScenarios":"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.","commonSituations":"A plugin manifest with a malformed dependency entry, manually edited dependency declarations, or a plugin build tool producing incorrect MANIFEST.MF dependency specifiers.","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."],"exampleFix":"// before\nnew PluginWrapper.Dependency(\"git\");\n\n// after\nnew PluginWrapper.Dependency(\"git:4.0.0\");","handlingStrategy":"validation","validationCode":"public static boolean isValidDependencySpecifier(String s) {\n    return s != null && s.indexOf(':') != -1;\n}","typeGuard":"public static boolean isValidDependencySpecifier(String s) {\n    if (s == null || s.isEmpty()) return false;\n    int idx = s.indexOf(':');\n    return idx > 0 && idx < s.length() - 1;\n}","tryCatchPattern":"try {\n    PluginWrapper.Dependency dep = new PluginWrapper.Dependency(spec);\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Invalid dependency specifier '\" + spec + \"'; expected 'name:version'\", e);\n}","preventionTips":["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."],"tags":["plugin-wrapper","dependency","parsing","manifest"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}