quarkusio/quarkus · error · QuarkusCommandException

Failed to add extensions

Error message

Failed to add extensions

What it means

AddExtensionsCommandHandler.execute wraps any IOException that occurs while resolving or adding extensions into a QuarkusCommandException('Failed to add extensions'). It signals the add-extensions command aborted due to I/O problems (catalog access, pom read/write) rather than unmatched keywords.

Solutions

  1. Inspect the cause stack trace (logged) to identify the underlying IOException
  2. Verify the project pom.xml exists and is writable
  3. Check network connectivity / registry URL configuration for the extensions catalog
  4. Retry the command; for offline use ensure a local registry cache is available
Defensive patterns

Strategy: try-catch

Validate before calling

Path pom = projectDir.resolve("pom.xml");
if (!Files.isRegularFile(pom) || !Files.isWritable(pom)) throw new IllegalStateException("pom.xml missing or not writable");

Try / catch

try { handler.execute(invocation); } catch (QuarkusCommandException e) { if (e.getCause() instanceof IOException io) { /* inspect io, check pom/network */ } }

Prevention

When it happens

Trigger: Executing the add-extensions command (AddExtensionsCommandHandler.execute) when reading the extension registry/catalog or transforming the project pom throws IOException.

Common situations: Unwritable or corrupt pom.xml; network failure fetching the registry catalog; interrupted downloads; disk full while writing the pom.

Related errors


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

Appendix: source

Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/AddExtensionsCommandHandler.java:100

                            .info(FAILURE_ICON + " Nothing installed because keyword(s) '"
                                    + String.join("', '", extensionInstallPlan.getInvalidKeywords())
                                    + "' were invalid.");
                }
            } else {
                invocation.log()
                        .info(FAILURE_ICON + " The provided keyword(s) did not match any extension from the catalog.");
            }
        } catch (MultipleExtensionsFoundException m) {
            StringBuilder sb = new StringBuilder();
            sb.append(ERROR_ICON + " Multiple extensions matching '").append(m.getKeyword()).append("'");
            m.getExtensions()
                    .forEach(extension -> sb.append(System.lineSeparator()).append("     - ")
                            .append(extension.managementKey()));
            sb.append(System.lineSeparator())
                    .append("     Be more specific e.g using the exact name or the full GAV.");
            invocation.log().info(sb.toString());
        } catch (IOException e) {
            throw new QuarkusCommandException("Failed to add extensions", e);
        }

        return QuarkusCommandOutcome.failure("see logs above for more details").setValue(AddExtensions.OUTCOME_UPDATED, false);
    }

    public ExtensionInstallPlan planInstallation(QuarkusCommandInvocation invocation, Collection<String> keywords)
            throws IOException {
        if (keywords.isEmpty()) {
            return ExtensionInstallPlan.EMPTY;
        }
        final ExtensionCatalog catalog = invocation.getExtensionsCatalog();
        final String quarkusCore = catalog.getQuarkusCoreVersion();
        final Collection<ArtifactCoords> importedPlatforms = invocation.getQuarkusProject().getExtensionManager()
                .getInstalledPlatforms();
        // TODO
        Set<ArtifactCoords> preferredBoms = Collections.emptySet();

        ExtensionInstallPlan.Builder builder = ExtensionInstallPlan.builder();

View on GitHub (pinned to e1c734241f)