{"record":{"id":"d0c1efe759d4b9b8","repo":"quarkusio/quarkus","slug":"can-t-be-used-as-file-strategy","errorCode":null,"errorMessage":" can't be used as '*' file strategy","messagePattern":" can't be used as '\\*' file strategy","errorType":"exception","errorClass":"CodestartStructureException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartProcessor.java","lineNumber":162,"sourceCode":"                            .add(new TargetFile(processedRelativeTargetPath, content.get()));\n                } else {\n                    final Path targetPath = targetDirectory.resolve(processedRelativeTargetPath);\n                    Files.createDirectories(targetPath.getParent());\n                    log.debug(\"ignoring file (but creating directory): %s\", source.absolutePath());\n                }\n            } catch (IOException e) {\n                throw new UncheckedIOException(e);\n            }\n        }\n    }\n\n    DefaultCodestartFileStrategyHandler getSelectedDefaultStrategy() {\n        for (CodestartFileStrategy codestartFileStrategy : strategies) {\n            if (Objects.equals(codestartFileStrategy.getFilter(), \"*\")) {\n                if (codestartFileStrategy.getHandler() instanceof DefaultCodestartFileStrategyHandler) {\n                    return (DefaultCodestartFileStrategyHandler) codestartFileStrategy.getHandler();\n                }\n                throw new CodestartStructureException(\n                        codestartFileStrategy.getHandler().name() + \" can't be used as '*' file strategy\");\n            }\n        }\n        return CodestartFileStrategyHandler.DEFAULT_STRATEGY;\n    }\n\n    Optional<CodestartFileStrategyHandler> getStrategy(final String key) {\n        for (CodestartFileStrategy codestartFileStrategy : strategies) {\n            if (codestartFileStrategy.test(key)) {\n                return Optional.of(codestartFileStrategy.getHandler());\n            }\n        }\n        return Optional.empty();\n    }\n}\n","sourceCodeStart":144,"sourceCodeEnd":178,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartProcessor.java#L144-L178","documentation":"The '*' filter in the codestart file-strategy spec selects the global default strategy, but only handlers implementing DefaultCodestartFileStrategyHandler are valid for it. This error means a non-default handler (e.g. one that requires special semantics) was assigned to the '*' catch-all filter, which the processor rejects.","triggerScenarios":"A codestart spec maps the '*' filter to a handler that is not a DefaultCodestartFileStrategyHandler; getSelectedDefaultStrategy (called from strategy/processLanguageDir/check methods) encounters it during generation.","commonSituations":"Misconfigured conflict-strategy block in codestarts.yml; copying a strategy mapping intended for a specific file filter to the '*' filter; version drift where a handler lost the default capability.","solutions":["Change the '*' mapping to a default-capable handler (e.g. default/override/merge)","Move the non-default handler to a specific file filter instead of '*'","Remove the '*' entry to fall back to CodestartFileStrategyHandler.DEFAULT_STRATEGY"],"exampleFix":"# before\nconflict-strategy:\n  '*': merge\n# after\nconflict-strategy:\n  '*': override\n  'src/main/docker/**': merge","handlingStrategy":"validation","validationCode":"Object h = CodestartFileStrategyHandler.BY_NAME.get(spec.get(\"*\"));\nif (!(h instanceof DefaultCodestartFileStrategyHandler))\n    throw new IllegalArgumentException(\"'*' needs a DefaultCodestartFileStrategyHandler\");","typeGuard":"boolean defaultCapable(String name) {\n    Object h = CodestartFileStrategyHandler.BY_NAME.get(name);\n    return h instanceof DefaultCodestartFileStrategyHandler;\n}","tryCatchPattern":"try { buildStrategies(spec); }\ncatch (CodestartStructureException e) {\n    if (e.getMessage().endsWith(\"can't be used as '*' file strategy\")) { /* fix '*' mapping */ }\n    else throw e;\n}","preventionTips":["Keep '*' mapped to default-capable handlers only","Attach special handlers to narrow file filters","Validate specs before generation"],"tags":["configuration","codestart","yaml"],"backgroundTag":"invalid-default-file-strategy","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"}