{"record":{"id":"e324f657dcbc87b6","repo":"jenkinsci/jenkins","slug":"0-is-not-a-jenkins-plugin","errorCode":null,"errorMessage":"{0} is not a Jenkins plugin","messagePattern":"(.+?) is not a Jenkins plugin","errorType":"validation","errorClass":"Failure","httpStatus":null,"severity":"warning","filePath":"core/src/main/java/hudson/PluginManager.java","lineNumber":1944,"sourceCode":"            List<DiskFileItem> items = upload.parseRequest(req);\n            String string = items.get(1).getString();\n            if (string != null && !string.isBlank()) {\n                // this is a URL deployment\n                fileName = string;\n                copier = new UrlPluginCopier(fileName);\n            } else {\n                // this is a file upload\n                FileItem fileItem = items.getFirst();\n                fileName = Util.getFileName(fileItem.getName());\n                copier = new FileUploadPluginCopier(fileItem);\n            }\n\n            if (\"\".equals(fileName)) {\n                return new HttpRedirect(\"advanced\");\n            }\n            // we allow the upload of the new jpi's and the legacy hpi's\n            if (!fileName.endsWith(\".jpi\") && !fileName.endsWith(\".hpi\")) {\n                throw new Failure(hudson.model.Messages.Hudson_NotAPlugin(fileName));\n            }\n\n            // first copy into a temporary file name\n            File t = File.createTempFile(\"uploaded\", \".jpi\", tmpDir);\n            tmpDir.deleteOnExit();\n            t.deleteOnExit();\n            // TODO Remove this workaround after FILEUPLOAD-293 is resolved.\n            Files.delete(Util.fileToPath(t));\n            try {\n                copier.copy(t);\n            } catch (Exception e) {\n                // Exception thrown is too generic so at least limit the scope where it can occur\n                throw new ServletException(e);\n            }\n            copier.cleanup();\n\n            final String baseName = identifyPluginShortName(t);\n","sourceCodeStart":1926,"sourceCodeEnd":1962,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/PluginManager.java#L1926-L1962","documentation":"Failure thrown when a file upload during plugin installation does not have a .jpi or .hpi extension. The message comes from hudson.model.Messages.Hudson_NotAPlugin. Jenkins only accepts Jenkins Plugin Interface (.jpi) or legacy Hudson Plugin Interface (.hpi) archives.","triggerScenarios":"Uploading a file via the plugin upload form (doUpload) where the filename does not end in .jpi or .hpi — e.g., .zip, .jar, .tar.gz, or a file with no extension.","commonSituations":"A user accidentally uploads a generic JAR, ZIP, or the wrong file type through the Advanced > Upload Plugin form; or an automated deployment script sends the wrong archive.","solutions":["Ensure the uploaded file is a valid Jenkins plugin archive (.jpi).","If building a custom plugin, run 'mvn hpi:hpi' or 'mvn package' to produce the .hpi/.jpi.","Validate the file extension before uploading in automation scripts."],"exampleFix":"// before\nFile file = new File(\"my-plugin.zip\");\n// upload fails: not a Jenkins plugin\n\n// after\nFile file = new File(\"my-plugin.jpi\");\n// ensure it was built with: mvn hpi:hpi","handlingStrategy":"validation","validationCode":"if (!fileName.endsWith(\".jpi\") && !fileName.endsWith(\".hpi\")) {\n    throw new IllegalArgumentException(\"File must be a .jpi or .hpi plugin archive: \" + fileName);\n}","typeGuard":"public static boolean isJenkinsPluginArchive(String fileName) {\n    return fileName != null && (fileName.endsWith(\".jpi\") || fileName.endsWith(\".hpi\"));\n}","tryCatchPattern":null,"preventionTips":["Only upload .jpi or .hpi files through the plugin upload form.","Build plugins with 'mvn hpi:hpi' to produce the correct archive format.","Validate file extension in automation scripts before upload."],"tags":["plugin-manager","upload","validation","file-format"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}