quarkusio/quarkus · error · MojoExecutionException
Unable to update the pom.xml file
Error message
Unable to update the pom.xml file
What it means
RemoveExtensionMojo.doExecute wraps the whole RemoveExtensions invocation in a try/catch(Exception) and rethrows any thrown exception as MojoExecutionException 'Unable to update the pom.xml file'. This indicates the removal command crashed (rather than returning an unsuccessful outcome) — typically an I/O or model error while reading/rewriting pom.xml.
Source
Thrown at devtools/maven/src/main/java/io/quarkus/maven/RemoveExtensionMojo.java:67
Set<String> ext = new HashSet<>();
if (extensions != null && !extensions.isEmpty()) {
ext.addAll(extensions);
} else {
// Parse the "extension" just in case it contains several comma-separated values
// https://github.com/quarkusio/quarkus/issues/2393
ext.addAll(Arrays.stream(extension.split(",")).map(s -> s.trim()).collect(Collectors.toSet()));
}
try {
final QuarkusCommandOutcome outcome = new RemoveExtensions(quarkusProject)
.extensions(ext.stream().map(String::trim).collect(Collectors.toSet()))
.execute();
if (!outcome.isSuccess()) {
throw new MojoExecutionException("Unable to remove extensions");
}
} catch (Exception e) {
throw new MojoExecutionException("Unable to update the pom.xml file", e);
}
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Check the 'Caused by' of this exception for the root cause
- Confirm pom.xml is writable and valid XML (mvn validate)
- Close IDE locks/git operations on pom.xml and retry
- Run `mvn quarkus:remove-extension` from the module directory rather than an unrelated aggregator if module resolution is the issue
Defensive patterns
Strategy: try-catch
Validate before calling
// Ensure pom is writable and well-formed before running: mvn validate && test -w pom.xml && echo writable
Try / catch
catch (MojoExecutionException e) {
Throwable root = e;
while (root.getCause() != null) root = root.getCause();
log.error("pom update failed, root cause: {}", root.getMessage(), root);
} Prevention
- Don't run the mojo while the pom is open with unsaved IDE edits or held by git operations
- Keep pom.xml XML valid (run mvn validate regularly)
- Run dev-mode goals from a workspace with normal file permissions
- Commit before running so any partial pom rewrite is recoverable
When it happens
Trigger: Any exception thrown inside new RemoveExtensions(...).execute(): IOException writing the pom, Maven model reading errors, concurrent modification/locking of pom.xml, or invalid project model passed via quarkusProject.
Common situations: pom.xml is read-only or locked by another process (IDE, git operation); malformed pom.xml XML; running the mojo in a multi-module setup where the targeted module cannot be resolved; disk full.
Related errors
- Unable to parse pom file: ${pom}
- Could not resolve POM for
- Unable to update the pom.xml file
- The parent project must have a packaging type of POM. Curren
- Failed to log the dependency tree to a file
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/37548fe788e18421.
Report an issue: GitHub.