quarkusio/quarkus · error · QuarkusCommandException

You need to define '${key}' because it was not found in the

Error message

You need to define  '${key}' because it was not found in the project hierarchy.

What it means

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.

Source

Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/CreateExtension.java:479

    public static boolean isQuarkiverseGroupId(String groupId) {
        return groupId != null && groupId.contains(DEFAULT_QUARKIVERSE_PARENT_GROUP_ID);
    }

    public static String extractQuarkiverseExtensionId(String groupId) {
        return groupId.replace(DEFAULT_QUARKIVERSE_PARENT_GROUP_ID + ".", "");
    }

    private void ensureRequiredStringData(QuarkusExtensionData key) throws QuarkusCommandException {
        if (!data.containsNonEmptyStringForKey(key)) {
            throw new QuarkusCommandException("'" + key.toString() + "' value is required.");
        }
    }

    private void ensureRequiredStringData(QuarkusExtensionData key, String detectedValue) throws QuarkusCommandException {
        if (!data.containsNonEmptyStringForKey(key)) {
            if (isEmpty(detectedValue)) {
                throw new QuarkusCommandException(
                        "You need to define  '" + key.toString() + "' because it was not found in the project hierarchy.");
            }
            data.putIfNonEmptyString(key, detectedValue);
        }
    }

    static String resolveExtensionPackage(String groupId, String artifactId) {
        final Deque<String> segments = new ArrayDeque<>();
        for (String segment : groupId.split("[.\\-]+")) {
            if (segments.isEmpty() || !segments.peek().equals(segment)) {
                segments.add(segment);
            }
        }
        for (String segment : artifactId.split("[.\\-]+")) {
            if (!segments.contains(segment)) {
                segments.add(segment);
            }
        }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Explicitly define the missing key (e.g. group-id, version) in the command or data map
  2. Run the command inside a project whose parent POM provides the needed values
  3. Verify the parent pom.xml declares groupId/version/relativePath correctly

Example fix

// before
quarkus create-extension my-ext  // no groupId anywhere
// after
quarkus create-extension my-ext --group-id=org.acme
Defensive patterns

Strategy: validation

Validate before calling

if (!data.containsNonEmptyStringForKey(QuarkusExtensionData.GROUP_ID) && isEmpty(detectedGroupId)) {
    throw new IllegalStateException("define group-id explicitly; none found in project hierarchy");
}

Try / catch

try { createExtension.prepare(); } catch (QuarkusCommandException e) { if (e.getMessage().contains("was not found in the project hierarchy")) { supplyExplicitValueAndRetry(); } }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/28a9e439ff70ac56. Report an issue: GitHub.