{"record":{"id":"cbb8591a218a859c","repo":"quarkusio/quarkus","slug":"unable-to-determine-the-path-of-target","errorCode":null,"errorMessage":"Unable to determine the path of target/","messagePattern":"Unable to determine the path of target/","errorType":"console","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"core/processor/src/main/java/io/quarkus/annotation/processor/util/FilerUtil.java","lineNumber":192,"sourceCode":"    public Path writeModel(String filePath, Object value) {\n        Path yamlModelPath = getTargetPath().resolve(filePath);\n        try {\n            Files.createDirectories(yamlModelPath.getParent());\n            JacksonMappers.yamlObjectWriter().writeValue(yamlModelPath.toFile(), value);\n\n            return yamlModelPath;\n        } catch (IOException e) {\n            throw new IllegalStateException(\"Unable to write the model to: \" + yamlModelPath, e);\n        }\n    }\n\n    public Path getTargetPath() {\n        try {\n            FileObject dummyFile = processingEnv.getFiler().getResource(StandardLocation.CLASS_OUTPUT, \"\", \"dummy\");\n            return Paths.get(dummyFile.toUri()).getParent().getParent();\n        } catch (IOException e) {\n            processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, \"Unable to determine the path of target/\" + e);\n            throw new UncheckedIOException(e);\n        }\n    }\n\n    public Optional<Path> getPomPath() {\n        try {\n            Path pomPath = Paths.get(processingEnv.getFiler().getResource(StandardLocation.CLASS_OUTPUT, \"\", \"dummy\").toUri())\n                    .getParent().getParent().getParent().resolve(\"pom.xml\");\n\n            if (!Files.isReadable(pomPath)) {\n                return Optional.empty();\n            }\n\n            return Optional.of(pomPath.toAbsolutePath());\n        } catch (IOException e) {\n            return Optional.empty();\n        }\n    }\n","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/processor/src/main/java/io/quarkus/annotation/processor/util/FilerUtil.java#L174-L210","documentation":"FilerUtil.getTargetPath determines the module's target/ directory by asking the annotation-processing Filer for a dummy CLASS_OUTPUT resource and taking two parents of its URI. If the Filer throws IOException (no CLASS_OUTPUT location available) the path cannot be determined; the processor logs an error and rethrows as UncheckedIOException. This method backs yamlModelPath, so doc-model generation cannot proceed without it.","triggerScenarios":"Called during annotation processing when StandardLocation.CLASS_OUTPUT is not resolvable — e.g. processing invoked without a normal compilation output location, unusual Filer setups, or getResource(\"dummy\") failing due to environment/IO problems.","commonSituations":"Custom build setups where class output is virtual/in-memory; running the processor in non-standard toolchains or sandboxes; misconfigured output directories in the build.","solutions":["Ensure the module compiles to a normal on-disk classes output (standard Maven target/classes layout).","Rebuild with the standard toolchain: ./mvnw clean install -f extensions/<name>/ rather than custom compiler invocations.","Check the IOException detail in the printed message for the underlying cause (permissions, missing output dir) and fix that.","If using a custom build integration, guarantee Filer.getResource(CLASS_OUTPUT, ...) resolves to a filesystem location."],"exampleFix":"// before: custom compile with no output location\njavac -proc:only -processor ...\n// after: standard build so CLASS_OUTPUT exists\n./mvnw install -f extensions/<name>/","handlingStrategy":"validation","validationCode":"Path classes = Paths.get(\"target\", \"classes\");\nif (!Files.isDirectory(classes)) {\n    throw new IllegalStateException(\"Compile to a standard target/classes layout first\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    build();\n} catch (UncheckedIOException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Unable to determine the path of target/\")) {\n        rebuildWithStandardMavenLayout();\n    } else throw e;\n}","preventionTips":["Use standard Maven builds (./mvnw) so CLASS_OUTPUT is a real filesystem path.","Avoid -proc:only or in-memory compilation setups for extension modules.","Read the printed IOException detail — it names the underlying resource problem.","Keep the build toolchain (JDK, Maven) aligned with Quarkus requirements."],"tags":["quarkus","annotation-processor","filesystem","classpath"],"backgroundTag":"output-path-resolution-failed","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"}