{"record":{"id":"2761dae4880e5b06","repo":"quarkusio/quarkus","slug":"error-while-reading-base-pom-xml","errorCode":null,"errorMessage":"Error while reading base pom.xml","messagePattern":"Error while reading base pom\\.xml","errorType":"exception","errorClass":"QuarkusCommandException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateExtension.java","lineNumber":426,"sourceCode":"    }\n\n    private String computeDefaultNamespaceName(String namespaceId) {\n        if (isEmpty(namespaceId)) {\n            return \"\";\n        }\n        return capitalize(namespaceId) + \" - \";\n    }\n\n    public static Model resolveModel(Path dir) throws QuarkusCommandException {\n        final Path workingDir = resolveWorkingDir(dir);\n        final Path basePom = workingDir.resolve(\"pom.xml\");\n        if (!Files.isRegularFile(basePom)) {\n            return null;\n        }\n        try {\n            return MojoUtils.readPom(basePom.toFile());\n        } catch (IOException e) {\n            throw new QuarkusCommandException(\"Error while reading base pom.xml\", e);\n        }\n    }\n\n    private Model getStandaloneTempModel(Path workingDir, String runtimeArtifactId, String defaultVersion) {\n        final Model model = new Model();\n        model.setGroupId(data.getRequiredStringValue(GROUP_ID));\n        model.setArtifactId(runtimeArtifactId + \"-parent\");\n        model.setVersion(data.getStringValue(VERSION).orElse(defaultVersion));\n        model.setPomFile(workingDir.resolve(\"pom.xml\").toFile());\n        return model;\n    }\n\n    private String getRuntimeArtifactIdFromData() {\n        return data.getStringValue(NAMESPACE_ID).orElse(\"\")\n                + data.getRequiredStringValue(EXTENSION_ID);\n    }\n\n    private static Path resolveWorkingDir(Path dir) {","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateExtension.java#L408-L444","documentation":"During extension creation, CreateExtension reads the base pom.xml via MojoUtils.readPom to build the Maven model. If that read fails with an IOException, it is wrapped in a QuarkusCommandException with this message, meaning the base POM exists but could not be parsed or opened.","triggerScenarios":"Calling prepare/execute of CreateExtension when resolveModel (via baseModel) finds a regular file at the base pom path but MojoUtils.readPom throws IOException — unreadable file, malformed XML, or permission issues.","commonSituations":"Corrupted or hand-edited base pom.xml with invalid XML; file permission problems; encoding issues in the POM; the POM being modified concurrently while reading.","solutions":["Validate the base pom.xml is well-formed XML (e.g. mvn -f pom.xml validate)","Check file read permissions on the base pom.xml","Restore the base pom.xml from version control","Run the command again in case of a transient/concurrent file issue"],"exampleFix":"// validate before running\nmvn help:effective-pom -f /path/to/base/pom.xml // must succeed\n// then re-run quarkus create-extension","handlingStrategy":"try-catch","validationCode":"Path basePom = workingDir.resolve(\"pom.xml\");\nif (Files.isRegularFile(basePom)) { try { new String(Files.readAllBytes(basePom)); } catch (IOException e) { throw new IllegalStateException(\"unreadable pom\", e); } }","typeGuard":null,"tryCatchPattern":"try { command.execute(); } catch (QuarkusCommandException e) { if (e.getMessage().equals(\"Error while reading base pom.xml\")) { log.error(\"Base pom.xml unreadable/invalid: fix or restore it\", e.getCause()); } }","preventionTips":["Validate base pom.xml parses (mvn validate) before running create-extension","Keep base pom.xml under version control for easy restore","Avoid concurrent edits to the pom during generation"],"tags":["maven","pom","io"],"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-14T00:17:10.932Z"}