{"record":{"id":"7a7d441c56c2a4df","repo":"quarkusio/quarkus","slug":"does-not-exist-7a7d44","errorCode":null,"errorMessage":" does not exist","messagePattern":" does not exist","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceLoader.java","lineNumber":103,"sourceCode":"\n    private final Deque<WorkspaceModulePom> loadQueue = new ConcurrentLinkedDeque<>();\n    // Map key is the normalized absolute Path to the module directory\n    private final Map<Path, WorkspaceModulePom> knownModules = new ConcurrentHashMap<>();\n    private final Map<GAV, Model> loadedModules = new ConcurrentHashMap<>();\n    private final Consumer<WorkspaceModulePom> loadedModelProcessor;\n\n    private final LocalWorkspace workspace = new LocalWorkspace();\n    private final Path currentProjectPom;\n    private volatile LocalProject currentProject;\n\n    WorkspaceLoader(BootstrapMavenContext ctx, Path currentProjectPom, List<WorkspaceModulePom> providedModules)\n            throws BootstrapMavenException {\n        try {\n            final BasicFileAttributes fileAttributes = Files.readAttributes(currentProjectPom, BasicFileAttributes.class);\n            this.currentProjectPom = fileAttributes.isDirectory() ? locateCurrentProjectPom(currentProjectPom)\n                    : currentProjectPom;\n        } catch (IOException e) {\n            throw new IllegalArgumentException(currentProjectPom + \" does not exist\", e);\n        }\n        boolean queueCurrentPom = true;\n        if (providedModules != null) {\n            // queue all the provided POMs\n            for (var module : providedModules) {\n                if (queueCurrentPom && this.currentProjectPom.equals(module.pom)) {\n                    queueCurrentPom = false;\n                }\n                knownModules.put(module.getModuleDir(), module);\n                loadQueue.add(module);\n            }\n        }\n\n        if (queueCurrentPom) {\n            WorkspaceModulePom module = new WorkspaceModulePom(this.currentProjectPom);\n            knownModules.put(module.getModuleDir(), module);\n            loadQueue.add(module);\n        }","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceLoader.java#L85-L121","documentation":"The WorkspaceLoader constructor reads file attributes of the given currentProjectPom path. If Files.readAttributes throws IOException (path does not exist or is inaccessible), it wraps it in IllegalArgumentException(currentProjectPom + \" does not exist\"). Unlike the locate-based errors, here the caller supplied a path that is not present on disk at all.","triggerScenarios":"Calling new WorkspaceLoader(ctx, currentProjectPom, modules) (via BootstrapMavenContext) with a path that does not exist or is unreadable — a stale pom.xml reference, a typo in a path config, or a file deleted between path discovery and loader construction.","commonSituations":"A configured `quarkus` project path or system property pointing to a moved/deleted project; script passing the wrong directory; tests reusing temp dirs already cleaned up (e.g. @TempDir cleanup ordering); network-mounted path that vanished.","solutions":["Verify the path exists before constructing: `Files.exists(Files.isReadable)` — fix the configured path to point at the actual project pom.xml or directory.","Correct the system property / config that supplies the project path (typo check, absolute vs relative path).","Recreate the deleted pom.xml or re-clone/restore the project directory.","Catch IllegalArgumentException around loader construction and surface a clear user-facing message with the offending path."],"exampleFix":"// before\nPath pom = Path.of(System.getProperty(\"app.pom\")); // stale value\nWorkspaceLoader loader = ctx.newWorkspaceLoader(pom, ...);\n// after\nPath pom = Path.of(System.getProperty(\"app.pom\"));\nif (!Files.isReadable(pom)) {\n    throw new IllegalArgumentException(\"Project pom path does not exist: \" + pom);\n}\nWorkspaceLoader loader = ctx.newWorkspaceLoader(pom, ...);","handlingStrategy":"validation","validationCode":"static Path requireExistingPom(Path pom) {\n    if (!Files.exists(pom)) {\n        throw new IllegalArgumentException(\"Path does not exist: \" + pom);\n    }\n    return pom;\n}","typeGuard":"static boolean pathExists(Path p) {\n    return p != null && Files.exists(p);\n}","tryCatchPattern":"try {\n    WorkspaceLoader loader = ctx.newWorkspaceLoader(currentProjectPom, modules);\n} catch (IllegalArgumentException e) {\n    log.error(\"Project pom path invalid: \" + e.getMessage());\n}","preventionTips":["Check Files.exists()/isReadable on the project pom path before constructing the loader.","Fix stale configuration properties that point at moved or deleted projects.","In tests, capture the pom path before temp-dir cleanup runs.","Prefer discovering the pom (walk up) rather than hardcoding a path in scripts."],"tags":["maven","filesystem","path-not-found","quarkus-bootstrap"],"backgroundTag":"file-not-found","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"}