{"record":{"id":"262b7822b0a674d4","repo":"quarkusio/quarkus","slug":"only-example-can-be-selected-at-a-time-you-can-al","errorCode":null,"errorMessage":"Only example can be selected at a time (you can always use 'noCode' if needed)","messagePattern":"Only example can be selected at a time \\(you can always use 'noCode' if needed\\)","errorType":"exception","errorClass":"CodestartException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalog.java","lineNumber":174,"sourceCode":"                projectCodestarts.add(defaultCodestart);\n            } else {\n                projectInput.log().warn(\n                        defaultCodestart.getName() + \" codestart will not be applied (doesn't implement language '\"\n                                + languageName\n                                + \"' yet)\");\n            }\n        }\n\n        // check only one example\n        final long examples = projectCodestarts.stream()\n                .filter(QuarkusCodestartCatalog::isExample)\n                .count();\n\n        if (examples == 1) {\n            // remove extension codestarts\n            projectCodestarts.removeIf(QuarkusCodestartCatalog::isExtensionCodestart);\n        } else if (examples > 1) {\n            throw new CodestartException(\n                    \"Only example can be selected at a time (you can always use 'noCode' if needed)\");\n        }\n\n        projectInput.getData().putAll(generateSelectionData(projectInput, projectCodestarts));\n\n        return projectCodestarts;\n    }\n\n    private boolean isCoreBom(ArtifactCoords artifactCoords) {\n        return IO_QUARKUS_GROUP_ID.equals(artifactCoords.getGroupId()) && QUARKUS_BOM.equals(artifactCoords.getArtifactId());\n    }\n\n    private boolean isUniverseBom(ArtifactCoords artifactCoords) {\n        return IO_QUARKUS_GROUP_ID.equals(artifactCoords.getGroupId())\n                && QUARKUS_UNIVERSE_BOM.equals(artifactCoords.getArtifactId());\n    }\n\n    private boolean isPlatformBom(ArtifactCoords artifactCoords) {","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartCatalog.java#L156-L192","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Select only one example codestart per project generation","Use 'noCode' codestart to get a bare project without example code","Split generation into multiple projects if multiple example styles are needed"],"exampleFix":"// before\ninput.getExtensions().addAll(List.of(\"resteasy\", \"grpc\")); // both examples\n// after\ninput.getExtensions().add(\"resteasy\"); // single example only","handlingStrategy":"validation","validationCode":"long examples = selected.stream().filter(QuarkusCodestartCatalog::isExampleCodestart).count();\nif (examples > 1) { selected.removeIf(QuarkusCodestartCatalog::isExampleCodestart); selected.add(\"noCode\"); }","typeGuard":null,"tryCatchPattern":"try { catalog.select(projectInput, ...); } catch (CodestartException e) { log.warn(\"Multiple examples selected; falling back to noCode\"); projectInput.getData().put(\"codestarts\", \"noCode\"); ... }","preventionTips":["Keep at most one example codestart in any selection set","Default scripted selections to 'noCode' when examples are not explicitly required","Validate user-supplied codestart lists against the example category before calling select"],"tags":["codestart","project-generation","cli"],"backgroundTag":"multiple-examples-selected","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}