{"record":{"id":"97161933b81d9903","repo":"quarkusio/quarkus","slug":"invalid-directory-structure-file-not-found-pom","errorCode":null,"errorMessage":"Invalid directory structure, file not found: ${pom}","messagePattern":"Invalid directory structure, file not found: (.+?)","errorType":"exception","errorClass":"QuarkusCommandException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateExtensionCommandHandler.java","lineNumber":131,"sourceCode":"    private void updateITParentPomAndMoveDir(String extensionDirName, Path newExtensionDir, Path itTestDir)\n            throws QuarkusCommandException, IOException {\n        final Path itTestPom = checkPomExists(itTestDir);\n        new PomTransformer(itTestPom, StandardCharsets.UTF_8)\n                .transform(PomTransformer.Transformation.addModule(extensionDirName));\n        FileUtils.moveDirectory(newExtensionDir.resolve(\"integration-tests\").toFile(),\n                itTestDir.resolve(extensionDirName).toFile());\n    }\n\n    private void updateExtensionsParentPom(String extensionDirName, Path extensionsDir) throws QuarkusCommandException {\n        final Path extensionsPom = checkPomExists(extensionsDir);\n        new PomTransformer(extensionsPom, StandardCharsets.UTF_8)\n                .transform(PomTransformer.Transformation.addModule(extensionDirName));\n    }\n\n    public static Path checkPomExists(Path dir) throws QuarkusCommandException {\n        final Path pom = dir.resolve(\"pom.xml\");\n        if (!Files.exists(pom)) {\n            throw new QuarkusCommandException(\"Invalid directory structure, file not found: \" + pom.toString());\n        }\n        return pom;\n    }\n\n    public static Model readPom(Path dir) throws QuarkusCommandException {\n        final Path pom = checkPomExists(dir);\n        try {\n            return MojoUtils.readPom(pom.toFile());\n        } catch (IOException e) {\n            throw new QuarkusCommandException(\"Error while reading pom: \" + pom.toString(), e);\n        }\n    }\n}\n","sourceCodeStart":113,"sourceCodeEnd":145,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateExtensionCommandHandler.java#L113-L145","documentation":"checkPomExists verifies dir/pom.xml exists and throws QuarkusCommandException('Invalid directory structure, file not found: <pom>') otherwise. It guards operations (readPom, BOM/IT-test/extension pom edits) that assume a Maven module layout.","triggerScenarios":"Running create-extension with a parent/bom/it-test/extensions directory that lacks a pom.xml — typically when the command is invoked from the wrong root or with wrong --path/group-id layout.","commonSituations":"Running 'quarkus create extension' outside a multi-module Quarkus checkout; typo in target directory; attempting to nest the extension in a folder without a Maven parent pom.","solutions":["Run the command from the root of a multi-module Maven project that has a pom.xml","Verify the --path and directory arguments point at existing Maven modules","Add a pom.xml if the directory genuinely should be a Maven module","Check current working directory is the intended project root"],"exampleFix":"// before\nmvn io.quarkus:quarkus-maven-plugin:create-extension -DextensionId=foo  # run in ~/random-dir\n// after\ncd ~/quarkus  # multi-module checkout with root pom.xml\nmvn io.quarkus:quarkus-maven-plugin:create-extension -DextensionId=foo","handlingStrategy":"validation","validationCode":"Path pom = dir.resolve(\"pom.xml\");\nif (!Files.isRegularFile(pom)) throw new IllegalStateException(\"Not a Maven module (no pom.xml): \" + dir);","typeGuard":"static boolean isMavenModule(Path dir) {\n    return Files.isRegularFile(dir.resolve(\"pom.xml\"));\n}","tryCatchPattern":"try { Path pom = CreateExtensionCommandHandler.checkPomExists(dir); } catch (QuarkusCommandException e) { /* prompt user to run from project root */ }","preventionTips":["Run create-extension from the root of a multi-module checkout","Verify directory arguments before invoking","Keep root pom.xml committed","Avoid ad-hoc directories as targets"],"tags":["maven","pom","directory-structure"],"backgroundTag":"pom-not-found","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}