quarkusio/quarkus · error · CodestartException
Multiple selection for base codestart of type: '" + a.getSpe
Error message
Multiple selection for base codestart of type: '" + a.getSpec().getType() + "' that should be unique. Only one of '" + a.getSpec().getName() + "' and '" + b.getSpec().getName() + "' should be selected at once.
What it means
CodestartCatalogs.getBaseSelection() throws CodestartException when two candidates for the same base codestart type are BOTH explicitly selected (neither is a fallback). Only one codestart per base type may be selected at a time; a fallback + selected pair is fine, two selections is not.
Source
Thrown at independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartCatalogs.java:68
}
return true;
}).collect(Collectors.toList());
}
static Collection<Codestart> getBaseSelection(Collection<Codestart> codestarts, Set<String> selection) {
return codestarts.stream()
.filter(c -> c.getSpec().getType().isBase())
.filter(c -> c.getSpec().isFallback() || c.isSelected(selection))
.collect(Collectors.toMap(c -> c.getSpec().getType(), c -> c, (a, b) -> {
// When there is multiple matches for one key, one should be selected and the other a fallback.
if (a.getSpec().isFallback() && b.getSpec().isFallback()) {
throw new CodestartStructureException(
"Multiple fallback found for a base codestart of type: '" + a.getSpec().getType()
+ "' that should be unique. Only one of '" + a.getSpec().getName() + "' and '"
+ b.getSpec().getName() + "' should be a fallback");
}
if (!a.getSpec().isFallback() && !b.getSpec().isFallback()) {
throw new CodestartException(
"Multiple selection for base codestart of type: '" + a.getSpec().getType()
+ "' that should be unique. Only one of '" + a.getSpec().getName() + "' and '"
+ b.getSpec().getName() + "' should be selected at once.");
}
// The selected is picked.
return !a.getSpec().isFallback() ? a : b;
})).values();
}
static Collection<Codestart> getExtraSelection(Collection<Codestart> codestarts, Set<String> selection) {
return codestarts.stream()
.filter(c -> !c.getSpec().getType().isBase())
.filter(c -> c.getSpec().isPreselected() || c.isSelected(selection))
.collect(Collectors.toList());
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Deselect one of the two codestarts of that base type in the selection input.
- Check extension codestart metadata for a codestart auto-selected with the same type as a user-provided one.
- Use different types for codestarts that should be combined rather than being alternatives.
Example fix
// before quarkus create app --codestart=config-yaml --codestart=config-properties ... // after quarkus create app --codestart=config-yaml ...
Defensive patterns
Strategy: validation
Validate before calling
// dedupe selection by base type before calling select
Set<String> seen = new HashSet<>();
for (var name : selectedNames) {
var type = catalog.typeOf(name);
if (type.isBase() && !seen.add(type)) throw new IllegalArgumentException("Multiple selected codestarts for type " + type);
} Try / catch
try {
var selected = CodestartCatalogs.select(catalogs, selection);
} catch (CodestartException e) {
if (e.getMessage().contains("Multiple selection")) {
logger.error("Two selected codestarts share a base type — remove one from the selection");
}
throw e;
} Prevention
- Allow at most one selected codestart per base type in CLI/UI inputs.
- Check extension-provided codestarts for auto-selection conflicts.
- Use fallback flags for alternatives instead of multiple selections.
When it happens
Trigger: Passing a selection (e.g. --codestart or project generation input) that names two codestarts of the same base type, so Collectors.toMap's merge finds two non-fallback matches.
Common situations: Specifying conflicting codestarts on the quarkus CLI / project creation (e.g. two config or two tooling codestarts of the same type); an extension metadata file listing a selected codestart that collides with a user selection.
Related errors
- Failed to register command: <className>
- Multiple fallback found for a base codestart of type: '" + a
- Only example can be selected at a time (you can always use '
- More than one @QuarkusMain method found with name '${name}':
- Build metrics file cannot be read:
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/dbf010ebbe2ae440.
Report an issue: GitHub.