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.

Solutions

  1. Check the 'Caused by' of this exception for the root cause
  2. Confirm pom.xml is writable and valid XML (mvn validate)
  3. Close IDE locks/git operations on pom.xml and retry
  4. 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

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


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/37548fe788e18421. Report an issue: GitHub.

Appendix: 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)