{"record":{"id":"88aa463c28680559","repo":"halo-dev/halo","slug":"the-plugin-version-must-not-be-blank","errorCode":null,"errorMessage":"The plugin version must not be blank.","messagePattern":"The plugin version must not be blank\\.","errorType":"http","errorClass":"ServerWebInputException","httpStatus":400,"severity":"error","filePath":"application/src/main/java/run/halo/app/plugin/PluginUtils.java","lineNumber":19,"sourceCode":"package run.halo.app.plugin;\n\nimport java.util.Objects;\nimport lombok.experimental.UtilityClass;\nimport org.apache.commons.lang3.StringUtils;\nimport org.springframework.util.Assert;\nimport org.springframework.web.server.ServerWebInputException;\nimport run.halo.app.core.extension.Plugin;\n\n@UtilityClass\npublic class PluginUtils {\n\n    public static String generateFileName(Plugin plugin) {\n        Assert.notNull(plugin, \"The plugin must not be null.\");\n        Assert.notNull(plugin.getMetadata(), \"The plugin metadata must not be null.\");\n        Assert.notNull(plugin.getSpec(), \"The plugin spec must not be null.\");\n        String version = plugin.getSpec().getVersion();\n        if (StringUtils.isBlank(version)) {\n            throw new ServerWebInputException(\"The plugin version must not be blank.\");\n        }\n        return String.format(\"%s-%s.jar\", plugin.getMetadata().getName(), version);\n    }\n\n    /**\n     * Determine if the plugin is in development mode. Currently, we detect it from annotations.\n     *\n     * @param plugin is a manifest about plugin.\n     * @return true if the plugin is in development mode; false otherwise.\n     */\n    public static boolean isDevelopmentMode(Plugin plugin) {\n        var annotations = plugin.getMetadata().getAnnotations();\n        return annotations != null && Objects.equals(\"dev\", annotations.get(PluginConst.RUNTIME_MODE_ANNO));\n    }\n}\n","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/halo-dev/halo/blob/d2f5165f9c8f055ffcb3fa9c3f4032821a7b68c8/application/src/main/java/run/halo/app/plugin/PluginUtils.java#L1-L35","documentation":"Error \"The plugin version must not be blank.\" thrown in halo-dev/halo.","triggerScenarios":"Thrown at application/src/main/java/run/halo/app/plugin/PluginUtils.java:19 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a non-blank 'spec.version' in the plugin's plugin.yaml manifest and rebuild the plugin JAR.","Ensure the version value is a valid semver string (e.g. 1.0.0); an empty or whitespace-only version is rejected.","If the manifest was edited manually, restore the version field and repackage the plugin."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d2f5165f9c8f055ffcb3fa9c3f4032821a7b68c8","analyzedAt":"2026-08-14T00:18:38.915Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}