{"record":{"id":"eec87998b97c4631","repo":"quarkusio/quarkus","slug":"unable-to-update-the-pom-xml-file","errorCode":null,"errorMessage":"Unable to update the pom.xml file","messagePattern":"Unable to update the pom\\.xml file","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/AddExtensionMojo.java","lineNumber":68,"sourceCode":"            throws MojoExecutionException {\n        Set<String> ext = new HashSet<>();\n        if (extensions != null && !extensions.isEmpty()) {\n            ext.addAll(extensions);\n        } else {\n            // Parse the \"extension\" just in case it contains several comma-separated values\n            // https://github.com/quarkusio/quarkus/issues/2393\n            ext.addAll(Arrays.stream(extension.split(\",\")).map(String::trim).collect(toSet()));\n        }\n\n        try {\n            AddExtensions addExtensions = new AddExtensions(quarkusProject)\n                    .extensions(ext.stream().map(String::trim).collect(toSet()));\n            final QuarkusCommandOutcome outcome = addExtensions.execute();\n            if (!outcome.isSuccess()) {\n                throw new MojoExecutionException(\"Unable to add extensions\");\n            }\n        } catch (Exception e) {\n            throw new MojoExecutionException(\"Unable to update the pom.xml file\", e);\n        }\n    }\n}\n","sourceCodeStart":50,"sourceCodeEnd":72,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/AddExtensionMojo.java#L50-L72","documentation":"AddExtensionMojo.doExecute wraps any exception thrown while running AddExtensions (or updating the build file) into this MojoExecutionException with the original cause attached. It signals the pom.xml/build file update step failed, not that the extension lookup itself failed.","triggerScenarios":"Any Exception from addExtensions.execute() or the surrounding code — e.g. I/O errors reading/writing pom.xml, invalid XML, or errors inside the Quarkus project machinery.","commonSituations":"Malformed or locked pom.xml; running from a directory where pom.xml is read-only; custom build file layouts the tool cannot parse.","solutions":["Inspect the 'Caused by' chain of this exception for the root cause.","Validate pom.xml is well-formed and writable (check file permissions, IDE locks).","Re-run the command in a clean checkout to rule out corrupted build files."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!Files.isWritable(Path.of('pom.xml'))) throw new IllegalStateException('pom.xml is not writable')","typeGuard":null,"tryCatchPattern":"catch (MojoExecutionException e) { Throwable root = e; while (root.getCause() != null) root = root.getCause(); log.error('Root cause: ' + root); }","preventionTips":["Ensure pom.xml is valid XML and writable before running add-extension.","Avoid running the mojo while the POM is locked by an IDE or another build."],"tags":["maven","pom","io"],"backgroundTag":"build-file-update-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"}