quarkusio/quarkus · error · GradleException

Failed to build Quarkus application for

Error message

Failed to build Quarkus application for 

What it means

BuildWorker executes the Quarkus application build inside a Gradle worker for the given GAV. On BootstrapException the worker throws GradleException with the message 'Failed to build Quarkus application for <gav> due to <e>' — deliberately embedding the exception in the message because Gradle's abbreviated stack traces can hide the underlying cause. It means the main Quarkus build (augmentation) failed.

Source

Thrown at devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/worker/BuildWorker.java:97

                    LOGGER.info("AugmentResult.results = {}", results.stream().map(ArtifactResult::getPath)
                            .map(r -> r == null ? "null" : r.toString()).collect(Collectors.joining("\n    ", "\n    ", "")));
                }
                JarResult jar = result.getJar();
                LOGGER.info("AugmentResult:");
                if (jar == null) {
                    LOGGER.info("    .jar = null");
                } else {
                    LOGGER.info("    .jar.path = {}", jar.getPath());
                    LOGGER.info("    .jar.libraryDir = {}", jar.getLibraryDir());
                    LOGGER.info("    .jar.originalArtifact = {}", jar.getOriginalArtifact());
                    LOGGER.info("    .jar.uberJar = {}", jar.isUberJar());
                }
            }
            LOGGER.info("Quarkus application build was successful");
        } catch (BootstrapException e) {
            // Gradle "abbreviates" the stacktrace to something human-readable, but here the underlying cause might
            // get lost in the error output, so add 'e' to the message.
            throw new GradleException("Failed to build Quarkus application for " + gav + " due to " + e, e);
        }
    }

    private static class Slf4JMessageWriter implements MessageWriter {
        private final Logger logger;

        public Slf4JMessageWriter(final Logger logger) {
            this.logger = logger;
        }

        @Override
        public void info(String msg) {
            this.logger.info(msg);
        }

        @Override
        public void error(String msg) {
            this.logger.error(msg);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the full 'due to ...' message and its cause chain (run with --stacktrace or --info).
  2. Fix the specific quarkus.* configuration error named in the cause.
  3. Align all io.quarkus plugin/extension/BOM versions to one Quarkus release.
  4. Clean caches: ./gradlew --stop; rm -rf build .gradle; retry.
  5. Check JDK compatibility (Quarkus requires a supported JDK version).
Defensive patterns

Strategy: try-catch

Validate before calling

./gradlew quarkusShowEffectiveConfig  # catch invalid quarkus.* config early
# verify version alignment:
grep -r 'io.quarkus' gradle/libs.versions.toml build.gradle 2>/dev/null

Try / catch

try {
    ./gradlew quarkusBuild
} catch (GradleException e) {
    if (e.getMessage().startsWith("Failed to build Quarkus application for")) {
        // full cause is embedded in the message and its cause chain
        System.err.println(e.getMessage());
    }
}

Prevention

When it happens

Trigger: Running ./gradlew build/quarkusBuild (or build) where the Quarkus augmentation/bootstrap fails: a build step throws, configuration is invalid, the application model can't be built, or an extension recorder fails during bytecode generation.

Common situations: Typo or invalid value in quarkus.* properties; extension version mismatch between Quarkus core and extensions; missing required config for an extension (e.g. datasource URL); Java/Gradle version incompatibilities; corrupt Gradle cache.

Related errors


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