quarkusio/quarkus · error · MojoExecutionException

Failed to apply the updates

Error message

Failed to apply the updates

What it means

The final catch in UpdateMojo.processProjectState wraps any QuarkusCommandException from invoker.execute() as MojoExecutionException 'Failed to apply the updates' with the original exception attached as cause. This is the generic wrapper: the update command itself threw an unexpected exception rather than returning a failed outcome.

Source

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

        // 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. Inspect the cause chain of this MojoExecutionException for the underlying QuarkusCommandException
  2. Check that build files (pom.xml / build.gradle) are valid, writable, and not locked
  3. Commit or back up the project, then re-run `mvn quarkus:update` on a clean state
  4. As a last resort upgrade manually: bump quarkus.platform.version and follow the migration guide for the target version

Example fix

// manual fallback
<!-- before -->
<quarkus.platform.version>2.16.0.Final</quarkus.platform.version>
<!-- after -->
<quarkus.platform.version>3.15.1</quarkus.platform.version>
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure build files are valid and writable before updating:
mvn validate && test -w pom.xml && echo ok

Try / catch

catch (MojoExecutionException e) {
  if ("Failed to apply the updates".equals(e.getMessage()) && e.getCause() instanceof QuarkusCommandException) {
    log.error("Update command crashed; cause:", e.getCause());
  } else throw e;
}

Prevention

When it happens

Trigger: QuarkusCommandException thrown by UpdateProject.execute(): internal command errors such as IO problems rewriting build files, model resolution failures mid-rewrite, or command framework errors — anything that surfaces as QuarkusCommandException instead of a clean isSuccess()==false outcome.

Common situations: Filesystem permission problems while rewriting pom.xml/build.gradle; malformed build files that parse initially but fail on rewrite; transient IO errors; bugs in update recipes for exotic project layouts.

Related errors


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