quarkusio/quarkus · error · CodestartStructureException

ConflictStrategyHandler named '" + entry.getValue() + "'…

Error message

ConflictStrategyHandler named '" + entry.getValue() + "' not found. Used with filter '" + entry.getKey() + "'

What it means

CodestartProcessor.buildStrategies maps codestart conflict-strategy spec entries to named CodestartFileStrategyHandler instances via a BY_NAME registry. This error means a strategy name in the codestart spec (codestarts.yml / project generation config) does not match any registered handler. It is a configuration error in the codestart definition, not user code.

Solutions

  1. Fix the strategy name in the codestart spec to one of the registered handler names (e.g. default, override, merge, fail) — check CodestartFileStrategyHandler for valid values
  2. Update the custom codestart definition to match the current Quarkus codestart spec
  3. If a custom handler was intended, register/define it in the handlers enum before use

Example fix

# before
codestart:
  conflict-strategy:
    '*': overwrit
# after
codestart:
  conflict-strategy:
    '*': override
Defensive patterns

Strategy: validation

Validate before calling

spec.values().forEach(v -> {
    if (!CodestartFileStrategyHandler.BY_NAME.containsKey(v))
        throw new IllegalArgumentException("Unknown strategy handler: " + v);
});

Try / catch

try {
    CodestartProcessor.buildStrategies(spec);
} catch (CodestartStructureException e) {
    // surface the offending filter/strategy name from e.getMessage()
}

Prevention

When it happens

Trigger: A codestart YAML declares a 'conflict-strategy' (or file strategy) map whose value names a handler that is not in CodestartFileStrategyHandler.BY_NAME, and a project generation loads that codestart.

Common situations: Typos in strategy names in codestarts.yml; renaming/removing a handler enum constant while old codestarts still reference it; custom codestarts copied from an incompatible Quarkus version.

Related errors


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

Appendix: source

Thrown at independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartProcessor.java:94

        }
    }

    public void writeFiles() throws IOException {
        for (Map.Entry<String, List<TargetFile>> e : files.entrySet()) {
            final String relativePath = e.getKey();
            final CodestartFileStrategyHandler strategy = getStrategy(relativePath).orElse(getSelectedDefaultStrategy());
            log.debug("processing file '%s' with strategy %s", relativePath, strategy.name());
            strategy.process(targetDirectory, relativePath, e.getValue(), data);
        }
    }

    public static List<CodestartFileStrategy> buildStrategies(Map<String, String> spec) {
        final List<CodestartFileStrategy> codestartFileStrategyHandlers = new ArrayList<>(spec.size());

        for (Map.Entry<String, String> entry : spec.entrySet()) {
            final CodestartFileStrategyHandler handler = CodestartFileStrategyHandler.BY_NAME.get(entry.getValue());
            if (handler == null) {
                throw new CodestartStructureException("ConflictStrategyHandler named '" + entry.getValue()
                        + "' not found. Used with filter '" + entry.getKey() + "'");
            }
            codestartFileStrategyHandlers.add(new CodestartFileStrategy(entry.getKey(), handler));
        }
        return codestartFileStrategyHandlers;
    }

    void addBuiltinData() {
        // needed for azure functions codestart
        data.put("gen-info", Collections.singletonMap("time", System.currentTimeMillis()));
    }

    void processLanguageDir(final CodestartResource projectResource, final CodestartResource resource, final String languageDir,
            final Map<String, Object> finalData) {
        log.debug("processing dir: %s", resource.pathName());
        final List<Source> sources = resource.listSources(languageDir);

        for (Source source : sources) {

View on GitHub (pinned to e1c734241f)