quarkusio/quarkus · error · MojoExecutionException
Failed to generate JBang Quarkus project
Error message
Failed to generate JBang Quarkus project
What it means
Wraps a QuarkusCommandException from CreateJBangProject.execute() into a MojoExecutionException. The JBang project generation command threw while rendering templates or writing the project, aborting the quarkus:create-jbang goal.
Source
Thrown at devtools/maven/src/main/java/io/quarkus/maven/CreateJBangMojo.java:130
throw new MojoExecutionException("Failed to resolve Quarkus extension catalog", e);
}
final List<ResourceLoader> codestartsResourceLoader = codestartLoadersBuilder(log)
.catalog(catalog)
.artifactResolver(mvn)
.build();
final CreateJBangProject createJBangProject = new CreateJBangProject(QuarkusProject.of(projectDirPath, catalog,
codestartsResourceLoader, log, BuildTool.MAVEN, new JavaVersion(javaVersion)))
.extensions(extensions)
.javaVersion(javaVersion)
.setValue(NO_JBANG_WRAPPER, noJBangWrapper);
boolean success;
try {
success = createJBangProject.execute().isSuccess();
} catch (QuarkusCommandException e) {
throw new MojoExecutionException("Failed to generate JBang Quarkus project", e);
}
if (success) {
getLog().info("");
getLog().info("========================================================================");
getLog().warn("Quarkus JBang project is an experimental feature.");
getLog().info("========================================================================");
getLog().info("");
} else {
throw new MojoExecutionException(
"Failed to generate JBang Quarkus project");
}
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Read the chained QuarkusCommandException stack trace (-e/-X) for the concrete failure
- Run against a clean, empty, writable outputDirectory
- Delete suspicious artifacts under ~/.m2/repository/io/quarkus and re-resolve
- Update the Quarkus Maven plugin to the latest patch version
Example fix
// before mvn quarkus:create-jbang -DoutputDirectory=./existing-app // conflicts // after mvn quarkus:create-jbang -DoutputDirectory=./my-new-jbang-app
Defensive patterns
Strategy: try-catch
Validate before calling
java.nio.file.Path out = java.nio.file.Path.of(outputDirectory);
if (java.nio.file.Files.exists(out) && java.nio.file.Files.list(out).findAny().isPresent())
logger.warn("outputDirectory is not empty; generation may fail"); Try / catch
try {
mvn quarkus:create-jbang ...
} catch (MojoExecutionException e) {
if (e.getCause() != null) {
logger.error("JBang generation threw: {}", e.getCause().getMessage(), e); // fix root cause, rerun clean
}
} Prevention
- Generate into a clean, empty, writable directory
- Keep Quarkus Maven plugin and platform versions aligned
- Clear ~/.m2/repository/io/quarkus entries if codestart resource loading errors appear
When it happens
Trigger: createJBangProject.execute() throws QuarkusCommandException — template loading/rendering failures, codestart application errors, or I/O errors writing into outputDirectory.
Common situations: Read-only or partially populated outputDirectory, corrupt local Quarkus artifacts breaking codestart resource loading, plugin jar corruption, name/namespace conflicts with pre-existing files.
Related errors
- Failed to generate Extension
- Could not create directory ${outputDirectory}
- Failed to generate Quarkus project
- Failed to initialize Quarkus bootstrap Maven resolver
- Unable to determine groupId and artifactId of the jar that c
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/dc4c713aea136626.
Report an issue: GitHub.