quarkusio/quarkus · error · MojoExecutionException

Failed to persist extension descriptor ${output.resolve(Boot

Error message

Failed to persist extension descriptor ${output.resolve(BootstrapConstants.DESCRIPTOR_FILE_NAME)}

What it means

ExtensionDescriptorMojo.generate() writes the quarkus-extension.properties descriptor into target/classes/META-INF via PropertyUtils.store after creating the directory. Any IOException while creating directories or persisting the file is wrapped in a MojoExecutionException naming the descriptor file path.

Source

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

        props.setProperty(BootstrapConstants.PROP_DEPLOYMENT_ARTIFACT, deployment);

        recordConditionalDeps(props);
        recordCapabilities(props);
        recordClassLoadingConfig(props);
        recordDevModeConfig(props);

        final String quarkusCoreVersion = findQuarkusCoreVersion();
        final String quarkusCoreVersionRange = requiresQuarkusCore == null ? toVersionRange(quarkusCoreVersion)
                : requiresQuarkusCore;
        if (quarkusCoreVersionRange != null) {
            props.put("requires-quarkus-version", quarkusCoreVersionRange);
        }
        final Path output = outputDirectory.toPath().resolve(BootstrapConstants.META_INF);
        try {
            Files.createDirectories(output);
            PropertyUtils.store(props, output.resolve(BootstrapConstants.DESCRIPTOR_FILE_NAME));
        } catch (IOException e) {
            throw new MojoExecutionException(
                    "Failed to persist extension descriptor " + output.resolve(BootstrapConstants.DESCRIPTOR_FILE_NAME),
                    e);
        }

        // extension.json
        if (extensionFile == null) {
            extensionFile = output.resolve(BootstrapConstants.QUARKUS_EXTENSION_FILE_NAME).toFile();
        }

        ObjectNode extObject;
        if (!extensionFile.exists()) {
            // if does not exist look for fallback .json
            extensionFile = new File(extensionFile.getParent(), "quarkus-extension.json");
        }

        ObjectMapper mapper = null;
        if (extensionFile.exists()) {
            mapper = getMapper(extensionFile.toString().endsWith(".yaml"));

View on GitHub (pinned to e1c734241f)

Solutions

  1. Check free disk space and clean up if full (mvn clean or df -h)
  2. Remove a stale META-INF file that blocks directory creation, then mvn clean
  3. Fix permissions/ownership of the target directory
  4. Retry the build once transient I/O issues (NFS/network mounts) are resolved
Defensive patterns

Strategy: try-catch

Validate before calling

Path metaInf = targetDir.resolve("classes/META-INF");
if (metaInf.exists() && !metaInf.isDirectory()) Files.delete(metaInf);
if (metaInf.getParent().isDirectory() && !metaInf.getParent().canWrite()) throw new IllegalStateException("target not writable");

Try / catch

try {
  invoker.executeMaven("extension-descriptor");
} catch (MojoExecutionException e) {
  if (String.valueOf(e.getCause()).contains("persist extension descriptor")) {
    runMaven("clean"); invoker.executeMaven("extension-descriptor");
  } else throw e;
}

Prevention

When it happens

Trigger: Files.createDirectories or PropertyUtils.store throws IOException — read-only target directory, disk full, a META-INF path that exists as a regular file, or permission denied during the extension descriptor goal.

Common situations: Disk quota exceeded on CI; target/ locked by another process or container volume mounted read-only; stale target state where META-INF is a file instead of a directory; running the build as an unprivileged user.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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