quarkusio/quarkus · error · CodestartException

Only example can be selected at a time (you can always use '

Error message

Only example can be selected at a time (you can always use 'noCode' if needed)

What it means

Quarkus codestart selection limits project generation to at most one 'example' codestart (e.g. resteasy, resteasy-reactive examples). The catalog counts example-type codestarts in the selection and throws this CodestartException when more than one is chosen. You can always pick 'noCode' instead of an example to skip sample code.

Source

Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalog.java:174

                projectCodestarts.add(defaultCodestart);
            } else {
                projectInput.log().warn(
                        defaultCodestart.getName() + " codestart will not be applied (doesn't implement language '"
                                + languageName
                                + "' yet)");
            }
        }

        // check only one example
        final long examples = projectCodestarts.stream()
                .filter(QuarkusCodestartCatalog::isExample)
                .count();

        if (examples == 1) {
            // remove extension codestarts
            projectCodestarts.removeIf(QuarkusCodestartCatalog::isExtensionCodestart);
        } else if (examples > 1) {
            throw new CodestartException(
                    "Only example can be selected at a time (you can always use 'noCode' if needed)");
        }

        projectInput.getData().putAll(generateSelectionData(projectInput, projectCodestarts));

        return projectCodestarts;
    }

    private boolean isCoreBom(ArtifactCoords artifactCoords) {
        return IO_QUARKUS_GROUP_ID.equals(artifactCoords.getGroupId()) && QUARKUS_BOM.equals(artifactCoords.getArtifactId());
    }

    private boolean isUniverseBom(ArtifactCoords artifactCoords) {
        return IO_QUARKUS_GROUP_ID.equals(artifactCoords.getGroupId())
                && QUARKUS_UNIVERSE_BOM.equals(artifactCoords.getArtifactId());
    }

    private boolean isPlatformBom(ArtifactCoords artifactCoords) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Select only one example codestart per project generation
  2. Use 'noCode' codestart to get a bare project without example code
  3. Split generation into multiple projects if multiple example styles are needed

Example fix

// before
input.getExtensions().addAll(List.of("resteasy", "grpc")); // both examples
// after
input.getExtensions().add("resteasy"); // single example only
Defensive patterns

Strategy: validation

Validate before calling

long examples = selected.stream().filter(QuarkusCodestartCatalog::isExampleCodestart).count();
if (examples > 1) { selected.removeIf(QuarkusCodestartCatalog::isExampleCodestart); selected.add("noCode"); }

Try / catch

try { catalog.select(projectInput, ...); } catch (CodestartException e) { log.warn("Multiple examples selected; falling back to noCode"); projectInput.getData().put("codestarts", "noCode"); ... }

Prevention

When it happens

Trigger: Calling QuarkusCodestartCatalog.select (via CreateProject command) with a project input whose selected codestarts include two or more codestarts classified as examples (isExampleCodestart), e.g. requesting both 'resteasy' and 'resteasy-reactive' example codestarts at once.

Common situations: CLI/API users passing multiple example extensions when scaffolding a project; scripted generation combining e.g. grpc and rest examples; tooling that accumulates codestart selections without deduplicating examples.

Related errors


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