{"record":{"id":"58caefee4b748d00","repo":"apache/maven","slug":"failed-to-parse-plugin-descriptor-for-plugin-get","errorCode":null,"errorMessage":"Failed to parse plugin descriptor for ${plugin.getId()} (${pluginFile.getAbsolutePath()}): ${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":259,"sourceCode":"                                () -> pluginJar.getInputStream(pluginDescriptorEntry),\n                                plugin,\n                                pluginFile.getAbsolutePath());\n                    }\n                }\n            } else {\n                File pluginXml = new File(pluginFile, getPluginDescriptorLocation());\n\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    }","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java#L241-L277","documentation":"A wrapper around IOExceptions raised while locating and reading the plugin descriptor: it covers both real I/O failures while opening the jar entry or plugin.xml stream and the 'No plugin descriptor found' sentinel from the same try block. The PluginDescriptorParsingException names the plugin, the absolute artifact path and the cause message.","triggerScenarios":"The plugin.xml entry is unreadable from a truncated jar; a filesystem error while reading the local artifact; the missing-descriptor condition (no META-INF/maven/plugin.xml) surfaces through this wrapper with that text as the cause message.","commonSituations":"Corrupted downloads from flaky mirrors; disks or antivirus locking jar files mid-read; artifacts replaced by HTML error pages saved as jars.","solutions":["Read the cause message first: 'No plugin descriptor found' means the artifact is not a plugin; an I/O message means the jar may be corrupt.","Verify the artifact: unzip -t on the jar in the local repository to test archive integrity.","Delete the artifact folder under ~/.m2/repository and rebuild with -U to re-download.","Confirm the coordinates are a Maven plugin (packaging maven-plugin) before retrying."],"exampleFix":"rm -rf ~/.m2/repository/<group-path>/<artifactId>/<version>\nmvn -U groupId:artifactId:version:help","handlingStrategy":"validation","validationCode":"unzip -t \"$ART\" > /dev/null || { echo 'corrupt plugin artifact: ' \"$ART\"; exit 1; }","typeGuard":null,"tryCatchPattern":"try {\n    descriptor = pluginManager.getPluginDescriptor(plugin, repos, session.getRepositorySession());\n} catch (PluginDescriptorParsingException e) {\n    String cause = String.valueOf(e.getCause() == null ? \"\" : e.getCause().getMessage());\n    if (cause.contains(\"No plugin descriptor found\")) {\n        // wrong artifact, do not retry; otherwise purge and refetch\n    }\n    throw e;\n}","preventionTips":["Verify jar integrity after flaky downloads before running builds","Configure checksum enforcement on repositories to reject corrupt artifacts","Prefer stable mirrors and purge suspect artifacts with mvn -U"],"tags":["maven","plugin","descriptor","io","artifact"],"backgroundTag":"maven-plugin-descriptor-parse-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}