{"record":{"id":"f0e745597d0a0c1e","repo":"quarkusio/quarkus","slug":"failed-to-build-enhanced-artifact","errorCode":null,"errorMessage":"Failed to build enhanced artifact","messagePattern":"Failed to build enhanced artifact","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/BuildEnhancedArtifactMojo.java","lineNumber":121,"sourceCode":"        try {\n            try (CuratedApplication curatedApplication = bootstrapApplication()) {\n                AugmentAction action;\n                if (enhancementType == EnhancementType.AOT_CONTAINER_IMAGE) {\n                    action = curatedApplication.createAugmentor(\n                            BuildAotEnhancedCustomizerProducer.class.getName(),\n                            contextHolder.get());\n                    action.performCustomBuild(BuildEnhancedAotContainerImageCommandHandler.class.getName(), null,\n                            BuildAotOptimizedContainerImageResultBuildItem.class.getName());\n                } else if (enhancementType == EnhancementType.PGO_NATIVE_IMAGE) {\n                    action = curatedApplication.createAugmentor(\n                            BuildPgoEnhancedCustomizerProducer.class.getName(),\n                            contextHolder.get());\n                    action.performCustomBuild(BuildPgoOptimizedNativeCommandHandler.class.getName(), null,\n                            BuildPgoOptimizedNativeResultBuildItem.class.getName());\n                }\n            }\n        } catch (Exception e) {\n            throw new MojoExecutionException(\"Failed to build enhanced artifact\", e);\n        }\n    }\n}\n","sourceCodeStart":103,"sourceCodeEnd":125,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/BuildEnhancedArtifactMojo.java#L103-L125","documentation":"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.","triggerScenarios":"Any exception during quarkus bootstrap, augmentation, jar/native build, or performCustomBuild for PGO-optimized native images inside doExecute's try block.","commonSituations":"Compilation or augmentation errors in application code; missing native-image toolchain when the PGO/native path runs; misconfigured application properties discovered during augmentation.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (pgoEnabled && !nativeImageAvailable()) throw new IllegalStateException('native-image required for PGO build')","typeGuard":null,"tryCatchPattern":"catch (MojoExecutionException e) { Throwable root = e; while (root.getCause() != null) root = root.getCause(); log.error('Enhanced artifact build root cause: ' + root.getMessage(), root); }","preventionTips":["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."],"tags":["maven","build","native-image"],"backgroundTag":"build-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}