{"record":{"id":"5e214f553e5bb7e2","repo":"quarkusio/quarkus","slug":"failed-to-parse-pluginxml","errorCode":null,"errorMessage":"Failed to parse <pluginXml>","messagePattern":"Failed to parse <pluginXml>","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/CreateUtils.java","lineNumber":72,"sourceCode":"\n    private static Plugin resolvePluginInfo(Path pluginXml) throws MojoExecutionException {\n        if (!Files.exists(pluginXml)) {\n            throw new MojoExecutionException(\"Failed to locate \" + pluginXml);\n        }\n        final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n        try {\n            final DocumentBuilder db = dbf.newDocumentBuilder();\n            try (InputStream is = Files.newInputStream(pluginXml)) {\n                final Document doc = db.parse(is);\n                final Node pluginNode = getElement(doc.getChildNodes(), \"plugin\");\n                final Plugin plugin = new Plugin();\n                plugin.setGroupId(getChildElementTextValue(pluginNode, \"groupId\"));\n                plugin.setArtifactId(getChildElementTextValue(pluginNode, \"artifactId\"));\n                plugin.setVersion(getChildElementTextValue(pluginNode, \"version\"));\n                return plugin;\n            }\n        } catch (Throwable t) {\n            throw new MojoExecutionException(\"Failed to parse \" + pluginXml, t);\n        }\n    }\n\n    private static String getChildElementTextValue(final Node parentNode, String childName) throws MojoExecutionException {\n        final Node node = getElement(parentNode.getChildNodes(), childName);\n        final String text = getText(node);\n        if (text.isEmpty()) {\n            throw new MojoExecutionException(\n                    \"The \" + parentNode.getNodeName() + \" element description is missing child \" + childName);\n        }\n        return text;\n    }\n\n    private static Node getElement(NodeList nodeList, String name) throws MojoExecutionException {\n        for (int i = 0; i < nodeList.getLength(); ++i) {\n            final Node item = nodeList.item(i);\n            if (item.getNodeType() == Node.ELEMENT_NODE\n                    && (name.equals(item.getNodeName()) || name.equals(item.getLocalName()))) {","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/CreateUtils.java#L54-L90","documentation":"After confirming the plugin.xml file exists, resolvePluginInfo parses it with DocumentBuilder and extracts groupId/artifactId/version. Any Throwable during XML building/parsing or extraction is wrapped in this MojoExecutionException 'Failed to parse <pluginXml>'. It means the plugin descriptor exists but its content could not be read as a valid plugin.xml document.","triggerScenarios":"META-INF/maven/plugin.xml in the plugin jar is malformed/truncated (corrupted download), unreadable bytes, empty file, or the child-extraction helper throws (missing required elements leading to a thrown error in getChildElementTextValue/getText).","commonSituations":"Interrupted downloads leaving a truncated jar in ~/.m2; manually edited or regenerated plugin.xml; jar corruption on disk; packaging bugs where plugin.xml contains invalid XML.","solutions":["Inspect the 'Caused by' (often SAXParseException) to see the exact XML defect","Delete the cached quarkus-maven-plugin artifact from ~/.m2 and re-download with -U","Validate plugin.xml content manually: `unzip -p <jar> META-INF/maven/plugin.xml | xmllint -`","If you built the plugin locally, run a clean full build so the maven-plugin-plugin regenerates the descriptor"],"exampleFix":"# truncated/corrupted descriptor\nrm -rf ~/.m2/repository/io/quarkus/quarkus-maven-plugin\nmvn -U io.quarkus:quarkus-maven-plugin:create","handlingStrategy":"validation","validationCode":"# Validate the descriptor parses before use\nunzip -p quarkus-maven-plugin-*.jar META-INF/maven/plugin.xml | xmllint --noout - && echo VALID","typeGuard":null,"tryCatchPattern":"try {\n    Plugin p = resolvePluginInfo(pluginXml);\n} catch (MojoExecutionException e) {\n    Throwable cause = e.getCause();\n    if (cause instanceof org.xml.sax.SAXParseException spe) {\n        logger.error(\"Malformed plugin.xml at line \" + spe.getLineNumber() + \": \" + spe.getMessage());\n    }\n}","preventionTips":["Re-download artifacts after suspected truncated downloads (rm + mvn -U)","Validate plugin.xml with xmllint when diagnosing packaging issues","Run clean full builds of the plugin locally so maven-plugin-plugin regenerates the descriptor","Treat the 'Caused by' SAXParseException as the real diagnostic"],"tags":["maven","xml-parsing","plugin-descriptor"],"backgroundTag":"xml-parse-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}