{"record":{"id":"4c5322a81cb25d2a","repo":"quarkusio/quarkus","slug":"does-not-exist-4c5322","errorCode":null,"errorMessage":" does not exist","messagePattern":" does not exist","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/PathTreeBuilder.java","lineNumber":71,"sourceCode":"        }\n        excludes.add(expr);\n        return this;\n    }\n\n    List<String> getExcludes() {\n        return excludes;\n    }\n\n    PathFilter getPathFilter() {\n        return includes == null && excludes == null ? null : new PathFilter(includes, excludes);\n    }\n\n    public PathTree build() {\n        if (root == null) {\n            throw new RuntimeException(\"The tree root has not been provided\");\n        }\n        if (!Files.exists(root)) {\n            throw new IllegalArgumentException(root + \" does not exist\");\n        }\n        if (archive) {\n            return ArchivePathTree.forPath(root, getPathFilter(), manifestEnabled == null ? true : manifestEnabled);\n        }\n        if (Files.isDirectory(root)) {\n            return new DirectoryPathTree(root, getPathFilter(), manifestEnabled == null ? false : manifestEnabled);\n        }\n        return new FilePathTree(root, getPathFilter());\n    }\n}\n","sourceCodeStart":53,"sourceCodeEnd":82,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/PathTreeBuilder.java#L53-L82","documentation":"PathTreeBuilder.build() verifies the configured root exists on disk and throws IllegalArgumentException '<root> does not exist' when it does not. The root was provided (otherwise you'd get 'The tree root has not been provided') but points to a missing file/directory.","triggerScenarios":"Calling build() after setRoot(path) where Files.exists(root) is false — path typo, deleted target file, wrong working directory, or a directory created later in the build.","commonSituations":"Wiring a path tree to a build output (e.g. classes or generated-sources dir) that hasn't been produced yet; paths configured with environment-specific absolute values; running tests from a different module directory.","solutions":["Check Files.exists(root) before build() and report a clear error including the resolved absolute path (root.toAbsolutePath()).","Fix the configured path value or create the directory/file before building.","Ensure build ordering produces the target path before this code runs.","Catch IllegalArgumentException if absence is an expected, recoverable state."],"exampleFix":"// before\nPathTree tree = PathTreeBuilder.builder().setRoot(genDir).build();\n// after\nif (!Files.exists(genDir)) {\n    Files.createDirectories(genDir); // or fail with a clear message\n}\nPathTree tree = PathTreeBuilder.builder().setRoot(genDir).build();","handlingStrategy":"validation","validationCode":"if (root != null && !Files.exists(root)) {\n    throw new IllegalStateException(\"PathTreeBuilder root does not exist: \" + root.toAbsolutePath());\n}","typeGuard":"static boolean isBuildableRoot(Path root) {\n    return root != null && Files.exists(root);\n}","tryCatchPattern":"try {\n    PathTree tree = builder.build();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().endsWith(\"does not exist\")) {\n        log.errorf(\"Configured root missing; resolved to %s\", String.valueOf(root));\n    }\n    throw e;\n}","preventionTips":["Log root.toAbsolutePath() in errors to expose working-directory mismatches.","Create directories with Files.createDirectories when the root should exist by then.","Check build ordering so the target path exists before path-tree construction.","Avoid environment-specific absolute paths in config; use relative, resolved paths."],"tags":["illegal-argument","builder","quarkus-paths","missing-file"],"backgroundTag":"path-does-not-exist","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}