quarkusio/quarkus · error · MojoExecutionException

Failed to build quarkus application

Error message

Failed to build quarkus application

What it means

BuildMojo.doExecute wraps any Exception from the Quarkus application build (bootstrap, augmentation, packaging) into this MojoExecutionException, after clearing any system properties the plugin had set in a finally block. It is the top-level failure signal for quarkus:build.

Source

Thrown at devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java:190

                            original.setFile(result.getJar().getPath().toFile());
                        } else {
                            projectHelper.attachArtifact(mavenProject(), result.getJar().getPath().toFile(),
                                    result.getJar().getClassifier());
                        }
                        if (attachSboms) {
                            for (var sbom : result.getJar().getSboms()) {
                                projectHelper.attachArtifact(mavenProject(), sbom.getFormat(), sbom.getClassifier(),
                                        sbom.getSbomFile().toFile());
                            }
                        }
                    }
                }
            } finally {
                // Clear all the system properties set by the plugin
                propertiesToClear.forEach(System::clearProperty);
            }
        } catch (Exception e) {
            throw new MojoExecutionException("Failed to build quarkus application", e);
        }
    }

    @Override
    public void setLog(Log log) {
        super.setLog(log);
        MojoLogger.delegate = log;
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the 'Caused by' chain to find the root cause (compilation error, config problem, etc.).
  2. Run `mvn clean` and rebuild to clear stale augmentation output.
  3. Fix the application config or code issue reported during the augmentation phase, then rerun quarkus:build.
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate config before build
if (Files.exists(Path.of('src/main/resources/application.properties')) && hasUnsetPlaceholders()) throw new IllegalStateException('Resolve config placeholders before quarkus:build')

Try / catch

catch (MojoExecutionException e) { Throwable root = e; while (root.getCause() != null) root = root.getCause(); log.error('quarkus:build failed, root cause: ' + root.getMessage(), root); }

Prevention

When it happens

Trigger: Any exception in the doExecute try block: application compilation errors, augmentation/dependency resolution failures, config validation errors, or failures in application model building.

Common situations: Code does not compile; unsatisfied CDI/extension configuration (e.g. missing datasource); dependency conflicts surfaced during augmentation; system-property-driven build misconfiguration.

Related errors


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