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

  1. Read the chained QuarkusCommandException stack trace (-e/-X) for the concrete failure
  2. Run against a clean, empty, writable outputDirectory
  3. Delete suspicious artifacts under ~/.m2/repository/io/quarkus and re-resolve
  4. 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

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


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