{"record":{"id":"4250fefacd629500","repo":"quarkusio/quarkus","slug":"this-file-is-forbidden-in-the-output-strategy-defi","errorCode":null,"errorMessage":"This file is forbidden in the output-strategy definition: + relativePath","messagePattern":"This file is forbidden in the output-strategy definition: \\+ relativePath","errorType":"exception","errorClass":"CodestartStructureException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/strategy/ForbiddenCodestartFileStrategyHandler.java","lineNumber":21,"sourceCode":"import java.io.IOException;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.Map;\n\nimport io.quarkus.devtools.codestarts.CodestartStructureException;\nimport io.quarkus.devtools.codestarts.core.reader.TargetFile;\n\nfinal class ForbiddenCodestartFileStrategyHandler implements CodestartFileStrategyHandler {\n    @Override\n    public String name() {\n        return \"forbidden\";\n    }\n\n    @Override\n    public void process(Path targetDirectory, String relativePath, List<TargetFile> codestartFiles, Map<String, Object> data)\n            throws IOException {\n        if (codestartFiles.size() > 0) {\n            throw new CodestartStructureException(\"This file is forbidden in the output-strategy definition: \" + relativePath);\n        }\n    }\n}\n","sourceCodeStart":3,"sourceCodeEnd":25,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/strategy/ForbiddenCodestartFileStrategyHandler.java#L3-L25","documentation":"ForbiddenCodestartFileStrategyHandler throws CodestartStructureException if any codestart file matches a relativePath that the output-strategy definition marks as 'forbidden'. The strategy produces no output at all; its whole purpose is to assert that a path is never present in codestart output. Size>0 means some codestart contributed a file at the forbidden path.","triggerScenarios":"A codestart being applied contains a file whose relativePath is listed with the 'forbidden' output strategy in the project's output-strategy definition (codestartFiles.size() > 0).","commonSituations":"Project codestart defines paths it must never receive (e.g. legacy configs) but an included base/extension codestart still ships that file; a typo in the forbidden path is unlikely since the strategy only fires on an actual match.","solutions":["Remove the file from the offending codestart so it no longer matches the forbidden path","Remove or adjust the 'forbidden' entry in the output-strategy definition if the file is now legitimate","Exclude the codestart that contributes the forbidden file"],"exampleFix":"// before\noutput-strategy:\n  docker-compose.yml: forbidden\n  # but codestart still ships docker-compose.yml\n\n// after\n# either delete the file from the codestart, or change strategy:\noutput-strategy:\n  docker-compose.yml: merge","handlingStrategy":"validation","validationCode":"boolean hasForbidden = codestartFiles.stream()\n    .anyMatch(f -> forbiddenPaths.contains(f.getRelativePath()));\nif (hasForbidden) throw new IllegalStateException(\"Codestart ships a forbidden file\");","typeGuard":null,"tryCatchPattern":"try {\n    handler.process(targetDir, relativePath, codestartFiles, data);\n} catch (CodestartStructureException e) {\n    if (e.getMessage().startsWith(\"This file is forbidden\")) {\n        // locate and remove the offending codestart contribution\n    } else throw e;\n}","preventionTips":["Keep the output-strategy 'forbidden' list in sync with the files your codestarts actually ship","When adding a codestart to a project, check its files against the forbidden list first","Remove forbidden entries only deliberately, never as a quick workaround"],"tags":["codestarts","forbidden-file","output-strategy"],"backgroundTag":"forbidden-codestart-path","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"}