{"record":{"id":"9be16381d8ec3264","repo":"quarkusio/quarkus","slug":"error-while-reading-pom-pom","errorCode":null,"errorMessage":"Error while reading pom: ${pom}","messagePattern":"Error while reading pom: (.+?)","errorType":"exception","errorClass":"QuarkusCommandException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateExtensionCommandHandler.java","lineNumber":141,"sourceCode":"        final Path extensionsPom = checkPomExists(extensionsDir);\n        new PomTransformer(extensionsPom, StandardCharsets.UTF_8)\n                .transform(PomTransformer.Transformation.addModule(extensionDirName));\n    }\n\n    public static Path checkPomExists(Path dir) throws QuarkusCommandException {\n        final Path pom = dir.resolve(\"pom.xml\");\n        if (!Files.exists(pom)) {\n            throw new QuarkusCommandException(\"Invalid directory structure, file not found: \" + pom.toString());\n        }\n        return pom;\n    }\n\n    public static Model readPom(Path dir) throws QuarkusCommandException {\n        final Path pom = checkPomExists(dir);\n        try {\n            return MojoUtils.readPom(pom.toFile());\n        } catch (IOException e) {\n            throw new QuarkusCommandException(\"Error while reading pom: \" + pom.toString(), e);\n        }\n    }\n}\n","sourceCodeStart":123,"sourceCodeEnd":145,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateExtensionCommandHandler.java#L123-L145","documentation":"readPom wraps IOException from MojoUtils.readPom into QuarkusCommandException('Error while reading pom: <pom path>'). The pom exists (checkPomExists passed) but cannot be parsed/read, e.g. malformed XML or unreadable file.","triggerScenarios":"Calling readPom(dir) when the pom.xml is unreadable (permissions) or MojoUtils' Maven model builder fails with IOException.","commonSituations":"Corrupt or hand-edited pom.xml with invalid XML; file locked by another process; restrictive file permissions after checkout on shared filesystems.","solutions":["Validate the pom.xml is well-formed (mvn help:effective-pom or an XML validator)","Restore the pom from version control (git checkout -- pom.xml)","Check file read permissions on the pom","Look at the cause exception for the precise parse error and line"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Path pom = dir.resolve(\"pom.xml\");\nif (!Files.isReadable(pom)) throw new IllegalStateException(\"pom not readable: \" + pom);\ntry { new javax.xml.parsers.DocumentBuilderFactory().newDocumentBuilder().parse(pom.toFile()); }\ncatch (Exception e) { throw new IllegalStateException(\"pom is not well-formed XML: \" + pom, e); }","typeGuard":null,"tryCatchPattern":"try { Model m = CreateExtensionCommandHandler.readPom(dir); } catch (QuarkusCommandException e) { /* e.getCause() has the parse detail */ }","preventionTips":["Never hand-edit poms with non-XML-safe tools","Keep poms clean in git; revert local corruption","Check file permissions on shared filesystems","Run mvn validate before scaffolding commands"],"tags":["maven","pom","parse-error"],"backgroundTag":"pom-parse-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}