quarkusio/quarkus · error · MojoExecutionException

${e.getMessage()}

Error message

${e.getMessage()}

What it means

When the update command throws QuarkusUpdateExitErrorException (the command explicitly exited with an error, e.g. an embedded interactive updater like an SQL/JBang migration script requested an exit-with-error), UpdateMojo rethrows MojoExecutionException with just e.getMessage(). The message is whatever the update tooling put on the exception — it is deliberately surfaced verbatim.

Source

Thrown at devtools/maven/src/main/java/io/quarkus/maven/UpdateMojo.java:154

        invoker.rewriteDryRun(rewriteDryRun);

        // backward compat
        if (noRewrite != null && noRewrite) {
            rewrite = false;
        }

        if (rewrite != null) {
            invoker.rewrite(rewrite);
        }

        try {
            final QuarkusCommandOutcome result = invoker.execute();
            if (!result.isSuccess()) {
                throw new MojoExecutionException(
                        "Failed to apply the updates: " + result.getMessage());
            }
        } catch (QuarkusUpdateExitErrorException e) {
            throw new MojoExecutionException(e.getMessage());
        } catch (QuarkusCommandException e) {
            throw new MojoExecutionException("Failed to apply the updates", e);
        }
    }

    private static ArtifactCoords getPrimaryBom(ExtensionCatalog c) {
        return c.getDerivedFrom().isEmpty() ? c.getBom() : c.getDerivedFrom().get(0).getBom();
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the propagated e.getMessage() — it is the update tool's own error text
  2. Re-run quarkus:update interactively (attached terminal) so prompts in migration scripts can be answered
  3. Run the failing migration step manually, then retry quarkus:update
  4. Skip scripted migration by updating quarkus.platform.version manually and handle code changes yourself
Defensive patterns

Strategy: try-catch

Validate before calling

// Run non-interactive migration steps in a probe first:
mvn quarkus:update -DdryRun  # if supported, to surface script errors before applying

Try / catch

catch (MojoExecutionException e) {
  if (e.getMessage() == null || e.getMessage().isEmpty()) {
    log.error("Update script exited with error and no message; rerun with -X for details");
  } else {
    log.error("Migration tool error: {}", e.getMessage());
  }
}

Prevention

When it happens

Trigger: invoker.execute() throws QuarkusUpdateExitErrorException during processProjectState: the update command ran a step (often an external migration script) that terminated with a non-zero exit code, signalling the update must be aborted.

Common situations: Migration scripts invoked by quarkus:update failing (e.g. deprecated-API migration tool errors); script requires user input but runs non-interactively; platform-provided update scripts incompatible with the project state.

Related errors


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