quarkusio/quarkus · error · GradleException

Failed to apply recommended updates

Error message

Failed to apply recommended updates

What it means

The quarkusUpdate task, after computing update recommendations, runs the OpenRewrite-based UpdateProject invoker to rewrite the project's build files. This GradleException wraps any exception thrown by invoker.execute(), meaning the automated update could not be applied to the project (recipe failure, rewrite engine error, or file modification failure).

Source

Thrown at devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusUpdate.java:195

        if (rewritePluginVersion != null) {
            invoker.rewritePluginVersion(rewritePluginVersion);
        }
        invoker.targetPlatformVersion(targetPlatformVersion);
        invoker.rewriteDryRun(rewriteDryRun);

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

        if (rewrite != null) {
            invoker.rewrite(rewrite);
        }
        invoker.appModel(extension().getApplicationModel());
        try {
            invoker.execute();
        } catch (Exception e) {
            throw new GradleException("Failed to apply recommended 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. Run with --stacktrace to see the root cause from the rewrite engine.
  2. Update build files manually per the printed recommended versions, then re-run to confirm no changes remain.
  3. Ensure build.gradle is parseable and committed state is clean (rewrite may refuse/produce conflicts on dirty trees).
  4. Pin/update io.quarkus and plugin versions manually in gradle.properties / build script instead of relying on automatic rewrite.
Defensive patterns

Strategy: try-catch

Validate before calling

git status --porcelain  # ensure clean tree before automated rewrite
# verify build files parse:
./gradlew help -q

Try / catch

try {
    ./gradlew quarkusUpdate
} catch (GradleException e) {
    if (e.getMessage().equals("Failed to apply recommended updates")) {
        e.getCause().printStackTrace(); // OpenRewrite root cause
        // apply version bumps manually instead
    }
}

Prevention

When it happens

Trigger: Running ./gradlew quarkusUpdate when the OpenRewrite recipes fail: unparseable build.gradle/Gradle Kotlin DSL, custom build logic the recipes cannot transform, file locks on build scripts, or an exception inside invoker.execute().

Common situations: Projects with heavily customized Gradle build scripts that the rewrite recipes cannot parse or modify; build.gradle.kts syntax the Groovy/Kotlin parser rejects; version-control or OS locks on build files; plugin version incompatibilities with the target platform.

Related errors


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