quarkusio/quarkus · error · MojoExecutionException

${e.getMessage()}

Error message

${e.getMessage()}

What it means

ExtensionDescriptorMojo validates the assembled quarkus-extension.json via ExtensionMetadataValidator.validate(extObject). If validation fails with an IOException, the message of the underlying exception is rethrown as a MojoExecutionException, so the displayed text is whatever the validator reported (e.g. a missing/invalid required metadata field).

Source

Thrown at independent-projects/extension-maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java:376

            }
        }
        if (!extObject.has("description") && project.getDescription() != null) {
            extObject.put("description", project.getDescription());
        }

        setBuiltWithQuarkusCoreVersion(quarkusCoreVersion, extObject);
        setRequiresQuarkusCoreVersion(quarkusCoreVersionRange, extObject);
        addJavaVersion(extObject);
        addCapabilities(extObject);
        addSource(extObject);
        addExtensionDependencies(extObject);

        completeCodestartArtifact(mapper, extObject);

        try {
            ExtensionMetadataValidator.validate(extObject);
        } catch (IOException e) {
            throw new MojoExecutionException(e.getMessage(), e.getCause());
        }

        final DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter();
        prettyPrinter.indentArraysWith(DefaultIndenter.SYSTEM_LINEFEED_INSTANCE);

        try (BufferedWriter bw = Files
                .newBufferedWriter(output.resolve(BootstrapConstants.QUARKUS_EXTENSION_FILE_NAME))) {
            bw.write(getMapper(true).writer().with(prettyPrinter).writeValueAsString(extObject));
        } catch (IOException e) {
            throw new MojoExecutionException(
                    "Failed to persist " + output.resolve(BootstrapConstants.QUARKUS_EXTENSION_FILE_NAME), e);
        }

        try (BufferedWriter bw = Files
                .newBufferedWriter(output.resolve(BootstrapConstants.QUARKUS_EXTENSION_JSON_FILE_NAME))) {
            bw.write(getMapper(false).writer().with(prettyPrinter).writeValueAsString(extObject));
        } catch (IOException e) {
            throw new MojoExecutionException(

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read e.getMessage()/cause in the full stack trace to see which metadata field failed validation
  2. Fix the offending field in the extension descriptor (extension.xml or extension.json source file)
  3. Compare against a working extension descriptor of the same Quarkus version for required fields

Example fix

// before (extension.json)
"metadata": { "categories": [] }
// after
"metadata": { "categories": ["data"], "short-name": "myext" }
Defensive patterns

Strategy: validation

Validate before calling

// Validate required metadata fields in extension.json before running the goal
JsonNode meta = new ObjectMapper().readTree(extensionJson).get("metadata");
if (meta == null || meta.path("categories").isEmpty() || meta.path("short-name").asText().isEmpty()) {
  throw new IllegalStateException("extension metadata incomplete");
}

Try / catch

try {
  invoker.executeMaven("extension-descriptor");
} catch (MojoExecutionException e) {
  if (e.getMessage() != null && e.getMessage().contains("metadata")) { fixDescriptorMetadata(); }
  throw e;
}

Prevention

When it happens

Trigger: The extension descriptor (extension.xml or extension.json) lacks required metadata fields or contains values ExtensionMetadataValidator rejects, and the module executes the extension descriptor goal without skipping validation.

Common situations: Hand-edited extension.json missing required keys; metadata.name/description/categories empty; migrating an extension from an older descriptor format; typos in metadata fields after upgrading the Quarkus parent.

Related errors


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