{"record":{"id":"de00620da93bc185","repo":"apache/maven","slug":"invalid-plugin-descriptor-for-plugin-getid","errorCode":null,"errorMessage":"Invalid plugin descriptor for ${plugin.getId()} (${pluginFile})","messagePattern":"Invalid plugin descriptor for (.+?) \\((.+?)\\)","errorType":"exception","errorClass":"InvalidPluginDescriptorException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java","lineNumber":266,"sourceCode":"\n                if (pluginXml.isFile()) {\n                    pluginDescriptor = parsePluginDescriptor(\n                            () -> Files.newInputStream(pluginXml.toPath()), plugin, pluginXml.getAbsolutePath());\n                }\n            }\n\n            if (pluginDescriptor == null) {\n                throw new IOException(\"No plugin descriptor found at \" + getPluginDescriptorLocation());\n            }\n        } catch (IOException e) {\n            throw new PluginDescriptorParsingException(plugin, pluginFile.getAbsolutePath(), e);\n        }\n\n        List<String> errors = new ArrayList<>();\n        pluginValidator.validate(pluginArtifact, pluginDescriptor, errors);\n\n        if (!errors.isEmpty()) {\n            throw new InvalidPluginDescriptorException(\n                    \"Invalid plugin descriptor for \" + plugin.getId() + \" (\" + pluginFile + \")\", errors);\n        }\n\n        pluginDescriptor.setPluginArtifact(pluginArtifact);\n\n        return pluginDescriptor;\n    }\n\n    private String getPluginDescriptorLocation() {\n        return \"META-INF/maven/plugin.xml\";\n    }\n\n    private PluginDescriptor parsePluginDescriptor(\n            PluginDescriptorBuilder.StreamSupplier is, Plugin plugin, String descriptorLocation)\n            throws PluginDescriptorParsingException {\n        try {\n            return builder.build(is, descriptorLocation);\n        } catch (PlexusConfigurationException e) {","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java#L248-L284","documentation":"The plugin descriptor was found and parsed, but semantic validation failed: the configured PluginValidators collected error strings (missing or invalid values in plugin.xml - plugin/mojo metadata, parameters, requirements) and Maven throws InvalidPluginDescriptorException listing every problem for the plugin id and artifact file.","triggerScenarios":"A hand-edited or code-generated plugin.xml with required elements missing; a descriptor produced by an incompatible maven-plugin-plugin version; shading or relocation mangling the packaged descriptor.","commonSituations":"Teams patching plugin jars instead of rebuilding; CI building plugins with mismatched maven-plugin-plugin/annotations versions; custom packaging mangling META-INF/maven/plugin.xml.","solutions":["Read every listed error line - the validators name the exact invalid entries in the descriptor.","Rebuild the plugin from source with a current, aligned maven-plugin-plugin so the descriptor is regenerated.","Never hand-edit plugin.xml inside a packaged jar.","If a validator extension is configured in the build, check its rules and relax or fix the descriptor accordingly."],"exampleFix":"<!-- before: jar patched by overwriting plugin.xml -->\njar uf my-plugin.jar META-INF/maven/plugin.xml\n<!-- after: rebuild properly so descriptor and code agree -->\nmvn clean install -pl my-plugin","handlingStrategy":"validation","validationCode":"xmllint --noout target/classes/META-INF/maven/plugin.xml \\\n  && echo 'descriptor xml well-formed' || echo 'descriptor broken'","typeGuard":null,"tryCatchPattern":"try {\n    descriptor = pluginManager.getPluginDescriptor(plugin, repos, session.getRepositorySession());\n} catch (InvalidPluginDescriptorException e) {\n    // e.getMessages() lists every invalid descriptor entry; surface them verbatim\n    throw new IllegalStateException(String.join(\"; \", e.getMessages()), e);\n}","preventionTips":["Never hand-edit plugin.xml inside packaged jars","Keep maven-plugin-plugin and maven-plugin-annotations versions aligned in plugin builds","Run descriptor validation as part of the plugin's own build"],"tags":["maven","plugin","descriptor","validation"],"backgroundTag":"maven-plugin-descriptor-invalid","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}