quarkusio/quarkus · error · MojoExecutionException
Failed to build enhanced artifact
Error message
Failed to build enhanced artifact
What it means
BuildEnhancedArtifactMojo.doExecute wraps any Exception from the enhanced-artifact build pipeline (Quarkus bootstrap, augmentation, optional native/PGO steps) into this MojoExecutionException with the original cause. It marks the overall 'build enhanced artifact' goal as failed.
Source
Thrown at devtools/maven/src/main/java/io/quarkus/maven/BuildEnhancedArtifactMojo.java:121
try {
try (CuratedApplication curatedApplication = bootstrapApplication()) {
AugmentAction action;
if (enhancementType == EnhancementType.AOT_CONTAINER_IMAGE) {
action = curatedApplication.createAugmentor(
BuildAotEnhancedCustomizerProducer.class.getName(),
contextHolder.get());
action.performCustomBuild(BuildEnhancedAotContainerImageCommandHandler.class.getName(), null,
BuildAotOptimizedContainerImageResultBuildItem.class.getName());
} else if (enhancementType == EnhancementType.PGO_NATIVE_IMAGE) {
action = curatedApplication.createAugmentor(
BuildPgoEnhancedCustomizerProducer.class.getName(),
contextHolder.get());
action.performCustomBuild(BuildPgoOptimizedNativeCommandHandler.class.getName(), null,
BuildPgoOptimizedNativeResultBuildItem.class.getName());
}
}
} catch (Exception e) {
throw new MojoExecutionException("Failed to build enhanced artifact", e);
}
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Inspect the 'Caused by' chain for the root build failure.
- Fix the underlying compilation/augmentation error reported in the log.
- For PGO/native steps, verify GraalVM native-image is installed and configured correctly.
Defensive patterns
Strategy: try-catch
Validate before calling
if (pgoEnabled && !nativeImageAvailable()) throw new IllegalStateException('native-image required for PGO build') Try / catch
catch (MojoExecutionException e) { Throwable root = e; while (root.getCause() != null) root = root.getCause(); log.error('Enhanced artifact build root cause: ' + root.getMessage(), root); } Prevention
- Fix compilation/augmentation errors surfaced in the log first.
- Install and verify GraalVM native-image for native/PGO goals.
- Run `mvn clean` to clear stale augmentation state.
When it happens
Trigger: Any exception during quarkus bootstrap, augmentation, jar/native build, or performCustomBuild for PGO-optimized native images inside doExecute's try block.
Common situations: Compilation or augmentation errors in application code; missing native-image toolchain when the PGO/native path runs; misconfigured application properties discovered during augmentation.
Related errors
- Failed to build quarkus application
- The <parentNodeName> element description is missing child <c
- Failed to locate element <name>
- Failed to initialize file output writer
- Failed to log the dependency list to a file
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/f0e745597d0a0c1e.
Report an issue: GitHub.