{"record":{"id":"94dd4842a06d5a48","repo":"apache/maven","slug":"failed-to-parse-plugin-descriptor-for-plugin-get-94dd48","errorCode":null,"errorMessage":"Failed to parse plugin descriptor for ${plugin.getId()} (${descriptorLocation}): ${e.getMessage()}","messagePattern":"Failed to parse plugin descriptor for (.+?) \\((.+?)\\): (.+?)","errorType":"exception","errorClass":"PluginDescriptorParsingException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java","lineNumber":285,"sourceCode":"                    \"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) {\n            throw new PluginDescriptorParsingException(plugin, descriptorLocation, e);\n        }\n    }\n\n    @Override\n    public MojoDescriptor getMojoDescriptor(\n            Plugin plugin, String goal, List<RemoteRepository> repositories, RepositorySystemSession session)\n            throws MojoNotFoundException, PluginResolutionException, PluginDescriptorParsingException,\n                    InvalidPluginDescriptorException {\n        PluginDescriptor pluginDescriptor = getPluginDescriptor(plugin, repositories, session);\n\n        MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo(goal);\n\n        if (mojoDescriptor == null) {\n            throw new MojoNotFoundException(goal, pluginDescriptor);\n        }\n\n        return mojoDescriptor;\n    }","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java#L267-L303","documentation":"PluginDescriptorBuilder.build() hit a PlexusConfigurationException while reading plugin.xml: the XML is malformed or structurally wrong (unparsable content, wrong root element, invalid nesting). It is wrapped as PluginDescriptorParsingException with the exact descriptor location so you know which entry is broken.","triggerScenarios":"A corrupted or truncated plugin.xml entry inside the jar, typically after a flaky download; a jar entry replaced with garbage by a broken mirror; a descriptor written by incompatible tooling.","commonSituations":"Partial downloads stored in the local repository; mirrors serving error pages; jars processed by zip tools that mangled entries.","solutions":["Inspect the entry: unzip -p <jar> META-INF/maven/plugin.xml | head to see the actual content.","If it is garbage, delete the artifact folder under ~/.m2/repository and rebuild with -U (optionally switch mirrors).","If it is your own plugin, rebuild with mvn clean install so a fresh descriptor is packaged.","Run xmllint on the extracted file to pinpoint the XML error."],"exampleFix":"unzip -p my-plugin.jar META-INF/maven/plugin.xml | xmllint -\n# if it fails: purge and re-fetch\nrm -rf ~/.m2/repository/<group-path>/my-plugin && mvn -U my-plugin:help","handlingStrategy":"validation","validationCode":"unzip -p \"$ART\" META-INF/maven/plugin.xml | xmllint - \\\n  || echo 'plugin.xml is not valid XML: artifact corrupt, purge local copy'","typeGuard":null,"tryCatchPattern":"try {\n    descriptor = pluginManager.getPluginDescriptor(plugin, repos, session.getRepositorySession());\n} catch (PluginDescriptorParsingException e) {\n    if (e.getCause() instanceof PlexusConfigurationException) {\n        // XML itself is broken: purge ~/.m2 path and refetch rather than debugging the POM\n    }\n    throw e;\n}","preventionTips":["Enforce checksum verification for plugin repositories","Purge and re-download artifacts after mirror errors instead of retrying builds","Validate packaged plugin.xml with xmllint in the plugin's CI"],"tags":["maven","plugin","descriptor","xml","parsing"],"backgroundTag":"maven-plugin-descriptor-parse-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}