{"record":{"id":"28a9e439ff70ac56","repo":"quarkusio/quarkus","slug":"you-need-to-define-key-because-it-was-not-fo","errorCode":null,"errorMessage":"You need to define  '${key}' because it was not found in the project hierarchy.","messagePattern":"You need to define  '(.+?)' because it was not found in the project hierarchy\\.","errorType":"validation","errorClass":"QuarkusCommandException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateExtension.java","lineNumber":479,"sourceCode":"\n    public static boolean isQuarkiverseGroupId(String groupId) {\n        return groupId != null && groupId.contains(DEFAULT_QUARKIVERSE_PARENT_GROUP_ID);\n    }\n\n    public static String extractQuarkiverseExtensionId(String groupId) {\n        return groupId.replace(DEFAULT_QUARKIVERSE_PARENT_GROUP_ID + \".\", \"\");\n    }\n\n    private void ensureRequiredStringData(QuarkusExtensionData key) throws QuarkusCommandException {\n        if (!data.containsNonEmptyStringForKey(key)) {\n            throw new QuarkusCommandException(\"'\" + key.toString() + \"' value is required.\");\n        }\n    }\n\n    private void ensureRequiredStringData(QuarkusExtensionData key, String detectedValue) throws QuarkusCommandException {\n        if (!data.containsNonEmptyStringForKey(key)) {\n            if (isEmpty(detectedValue)) {\n                throw new QuarkusCommandException(\n                        \"You need to define  '\" + key.toString() + \"' because it was not found in the project hierarchy.\");\n            }\n            data.putIfNonEmptyString(key, detectedValue);\n        }\n    }\n\n    static String resolveExtensionPackage(String groupId, String artifactId) {\n        final Deque<String> segments = new ArrayDeque<>();\n        for (String segment : groupId.split(\"[.\\\\-]+\")) {\n            if (segments.isEmpty() || !segments.peek().equals(segment)) {\n                segments.add(segment);\n            }\n        }\n        for (String segment : artifactId.split(\"[.\\\\-]+\")) {\n            if (!segments.contains(segment)) {\n                segments.add(segment);\n            }\n        }","sourceCodeStart":461,"sourceCodeEnd":497,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateExtension.java#L461-L497","documentation":"Variant of ensureRequiredStringData that attempts to fill a missing data key from an auto-detected value (e.g. derived from the project hierarchy or parent POM). If the key is absent AND the detected value is empty, it throws this QuarkusCommandException telling the user to define the key because it could not be found in the project hierarchy.","triggerScenarios":"prepare on CreateExtension with a required QuarkusExtensionData key missing from data, and the detection step (e.g. reading groupId/version from the surrounding project) returning null/empty.","commonSituations":"Running create-extension outside a recognizable project hierarchy (no parent POM to inherit from); empty parent POM fields; non-interactive execution with no fallback available.","solutions":["Explicitly define the missing key (e.g. group-id, version) in the command or data map","Run the command inside a project whose parent POM provides the needed values","Verify the parent pom.xml declares groupId/version/relativePath correctly"],"exampleFix":"// before\nquarkus create-extension my-ext  // no groupId anywhere\n// after\nquarkus create-extension my-ext --group-id=org.acme","handlingStrategy":"validation","validationCode":"if (!data.containsNonEmptyStringForKey(QuarkusExtensionData.GROUP_ID) && isEmpty(detectedGroupId)) {\n    throw new IllegalStateException(\"define group-id explicitly; none found in project hierarchy\");\n}","typeGuard":null,"tryCatchPattern":"try { createExtension.prepare(); } catch (QuarkusCommandException e) { if (e.getMessage().contains(\"was not found in the project hierarchy\")) { supplyExplicitValueAndRetry(); } }","preventionTips":["Run create-extension inside a parent project whose POM defines groupId/version","Pass --group-id/--version explicitly in scripts","Verify parent POM resolution (relativePath) before invoking the command"],"tags":["validation","maven","extension-creation"],"backgroundTag":"missing-required-argument","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"}