quarkusio/quarkus · error · GradleException

Failed to remove extensions + getExtensionsToRemove()

Error message

Failed to remove extensions + getExtensionsToRemove()

What it means

QuarkusRemoveExtension.removeExtension builds the set of extensions to remove and executes RemoveExtensions against the QuarkusProject. Any Exception during execution (project setup, catalog resolution, or the removal itself) is wrapped as GradleException("Failed to remove extensions " + getExtensionsToRemove()).

Source

Thrown at devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRemoveExtension.java:48

    @Input
    public List<String> getExtensionsToRemove() {
        return extensionsToRemove;
    }

    @TaskAction
    public void removeExtension() {
        Set<String> extensionsSet = getExtensionsToRemove()
                .stream()
                .flatMap(ext -> stream(ext.split(",")))
                .map(String::trim)
                .collect(toSet());
        try {
            new RemoveExtensions(getQuarkusProject(true))
                    .extensions(extensionsSet)
                    .execute();
        } catch (Exception e) {
            throw new GradleException("Failed to remove extensions " + getExtensionsToRemove(), e);
        }
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Check the exact cause: run with --stacktrace/--info and address the wrapped exception (often registry or build-file parsing).
  2. Verify the extension name/artifactId is installed: run ./gradlew quarkusListExtensions and match coordinates.
  3. As a fallback, remove the dependency line from build.gradle manually.

Example fix

// before
./gradlew quarkusRemoveExtension --extensions="reactive-routes"

// after (correct artifact id)
./gradlew quarkusRemoveExtension --extensions="vertx-http"
Defensive patterns

Strategy: try-catch

Validate before calling

// confirm the extension is present before attempting removal
def coords = 'io.quarkus:quarkus-vertx-http'
assert configurations.implementation.allDependencies.any { "${it.group}:${it.artifactId}" == coords } : coords + ' not installed'

Try / catch

try { ./gradlew quarkusRemoveExtension --extensions=... } catch (GradleException e) { if (e.message.startsWith('Failed to remove extensions')) { logger.error('Cause: ' + e.cause) /* handle root cause */ } }

Prevention

When it happens

Trigger: Running ./gradlew quarkusRemoveExtension when the extension isn't installed, the platform catalog can't be resolved, the project build file can't be parsed/updated, or the project has no platform BOM (see related errors).

Common situations: Typo in the extension artifactId; removing an extension that was added as a direct dependency manually; network failure reaching the registry; mixed DSL build files breaking project parsing.

Related errors


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