{"record":{"id":"04c4223fbc298053","repo":"quarkusio/quarkus","slug":"failed-to-locate-resources-txt-in-the-project-s-re","errorCode":null,"errorMessage":"Failed to locate resources.txt in the project's resources","messagePattern":"Failed to locate resources\\.txt in the project's resources","errorType":"console","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"integration-tests/gradle/src/main/resources/test-resources-in-build-steps/deployment/src/main/java/org/acme/ext/deployment/AcmeExtProcessor.java","lineNumber":22,"sourceCode":"import io.quarkus.deployment.annotations.BuildStep;\nimport io.quarkus.deployment.builditem.ApplicationArchivesBuildItem;\nimport io.quarkus.deployment.builditem.FeatureBuildItem;\nimport io.quarkus.deployment.builditem.LaunchModeBuildItem;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.StandardCopyOption;\n\nclass AcmeExtProcessor {\n\n    private static final String FEATURE = \"acme-ext\";\n\n    @BuildStep\n    FeatureBuildItem feature(ApplicationArchivesBuildItem appArchivesBuildItem,\n            LaunchModeBuildItem launchModeBuildItem) {\n        Path p = appArchivesBuildItem.getRootArchive().getChildPath(\"resources.txt\");\n        if(p == null) {\n            throw new IllegalStateException(\"Failed to locate resources.txt in the project's resources\");\n        }\n\n        final Path output = p.getParent().getParent().getParent().resolve(launchModeBuildItem.getLaunchMode() + \"-\" + p.getFileName());\n        try {\n            Files.copy(p, output, StandardCopyOption.REPLACE_EXISTING);\n        } catch(IOException e) {\n            throw new IllegalStateException(\"Failed to copy \" + p + \" to \" + output, e);\n        }\n        return new FeatureBuildItem(FEATURE);\n    }\n}\n","sourceCodeStart":4,"sourceCodeEnd":34,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/gradle/src/main/resources/test-resources-in-build-steps/deployment/src/main/java/org/acme/ext/deployment/AcmeExtProcessor.java#L4-L34","documentation":"This IllegalStateException is thrown by a Quarkus integration-test extension build step when the application archive does not contain a file named resources.txt at its root. The processor uses ApplicationArchivesBuildItem.getRootArchive().getChildPath(\"resources.txt\") to locate the project's resources directory output; a null result means the test resource was not packaged into the app archive. It is a build-time assertion that the Gradle/Maven resource packaging worked as expected.","triggerScenarios":"Running the quarkus-gradle integration test when the test-resources-in-build-steps project's src/main/resources does not contain resources.txt, or when resource packaging/processing is skipped so the file is absent from the application archive root.","commonSituations":"Resource file renamed or deleted; Gradle processResources misconfigured or sourceSets changed; build running in a mode where the resources dir is not included in the archive (e.g. wrong module built); stale incremental build state.","solutions":["Add/restore resources.txt to the test project's src/main/resources directory","Verify the Gradle build's sourceSets/resources configuration includes src/main/resources","Run a clean build (./gradlew clean) to rule out stale incremental state","Check that the correct project/module is being built and its archive is passed to the build step"],"exampleFix":"// before: file missing\nsrc/main/resources/resources.txt  (absent)\n// after\nsrc/main/resources/resources.txt  (create file with any content)","handlingStrategy":"validation","validationCode":"Path p = appArchivesBuildItem.getRootArchive().getChildPath(\"resources.txt\");\nif (p == null) {\n    throw new IllegalStateException(\"resources.txt missing from app archive; check src/main/resources\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Files.copy(p, output, StandardCopyOption.REPLACE_EXISTING);\n} catch (IOException e) {\n    throw new IllegalStateException(\"Failed to copy \" + p + \" to \" + output, e);\n}","preventionTips":["Keep required marker files in src/main/resources and commit them","Run a clean build when resource packaging behavior changes","Assert resource presence early in the build step with a clear message"],"tags":["quarkus","build-step","resources","gradle","integration-test"],"backgroundTag":"missing-resource-file","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"}