{"record":{"id":"cdf799a0edac58a6","repo":"jenkinsci/jenkins","slug":"jar-lacks-a-manifest","errorCode":null,"errorMessage":"JAR lacks a manifest","messagePattern":"JAR lacks a manifest","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/hudson/cli/InstallPluginCommand.java","lineNumber":180,"sourceCode":"\n            throw new AbortException(\"Error occurred, see previous output.\");\n        }\n\n        if (restart)\n            h.safeRestart();\n        return 0; // all success\n    }\n\n    private static File getTmpFile() throws Exception {\n        return File.createTempFile(\"download\", \".jpi.tmp\", Jenkins.get().getPluginManager().rootDir);\n    }\n\n    private static File moveToFinalLocation(File tmpFile) throws Exception {\n        String pluginName;\n        try (JarFile jf = new JarFile(tmpFile)) {\n            Manifest mf = jf.getManifest();\n            if (mf == null) {\n                throw new IllegalArgumentException(\"JAR lacks a manifest\");\n            }\n            pluginName = mf.getMainAttributes().getValue(\"Short-Name\");\n        }\n        if (pluginName == null) {\n            throw new IllegalArgumentException(\"JAR manifest lacks a Short-Name attribute and so does not look like a plugin\");\n        }\n        File target = new File(Jenkins.get().getPluginManager().rootDir, pluginName + \".jpi\");\n        Files.move(tmpFile.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE);\n        return target;\n    }\n}\n","sourceCodeStart":162,"sourceCodeEnd":192,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/cli/InstallPluginCommand.java#L162-L192","documentation":"Error \"JAR lacks a manifest\" thrown in jenkinsci/jenkins.","triggerScenarios":"Raised when the install-plugin CLI command is given a local file that is not a valid JAR/HPI (no META-INF/MANIFEST.MF).","commonSituations":"See trigger scenarios.","solutions":["Verify the file is a valid JAR/HPI plugin archive, not an HTML error page or corrupted download.","Re-download the plugin from the Jenkins update center or plugins.jenkins.io.","Inspect the archive with 'jar tf <file>' to confirm it is a well-formed JAR."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}