quarkusio/quarkus · error · GradleException

Unable to list platforms

Error message

Unable to list platforms

What it means

The QuarkusListPlatforms Gradle task (./gradlew listPlatforms) uses the ListPlatforms tool to print the Quarkus platforms imported into the project or available in the registry. Any Exception thrown by ListPlatforms.execute() is wrapped in this GradleException, indicating platform metadata could not be collected.

Source

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

    @TaskAction
    public void listExtensions() {
        getLogger().info("");
        if (installed) {
            getLogger().info("Imported Quarkus platforms:");
            importedPlatforms().forEach(coords -> {
                final StringBuilder buf = new StringBuilder();
                buf.append(coords.getGroupId()).append(":")
                        .append(coords.getArtifactId().substring(0,
                                coords.getArtifactId().length() - Constants.PLATFORM_DESCRIPTOR_ARTIFACT_ID_SUFFIX.length()))
                        .append("::pom:").append(coords.getVersion());
                messageWriter().info(buf.toString());
            });
        } else {
            getLogger().info("Available Quarkus platforms:");
            try {
                new ListPlatforms(getQuarkusProject(installed)).execute();
            } catch (Exception e) {
                throw new GradleException("Unable to list platforms", e);
            }
        }
        getLogger().info("");
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Run ./gradlew listPlatforms --stacktrace to see the wrapped cause.
  2. Verify the enforcedPlatform/quarkus-bom declaration and its version.
  3. Check connectivity to registry.quarkus.io and set proxy system properties if needed.
  4. Clear Gradle caches of io.quarkus.platform entries and re-resolve with --refresh-dependencies.
  5. If platforms are intentional, list extensions instead to confirm what is imported.

Example fix

// before
./gradlew listPlatforms
// after: diagnose root cause
./gradlew listPlatforms --stacktrace --info
Defensive patterns

Strategy: retry

Validate before calling

// Ensure at least one platform is imported and registry is reachable
./gradlew dependencies --configuration runtimeClasspath | grep quarkus-bom
curl -fsSL https://registry.quarkus.io/ > /dev/null && echo reachable

Try / catch

try {
  ./gradlew listPlatforms
} catch (GradleException e) {
  if (e.getMessage().equals("Unable to list platforms")) {
    // view wrapped cause with --stacktrace; verify BOM/network, clear stale platform cache entries, retry
  }
}

Prevention

When it happens

Trigger: Running ./gradlew listPlatforms when ListPlatforms.execute() throws: failure resolving imported platforms from the application model or contacting the extension registry; raised in QuarkusListPlatforms.listExtensions.

Common situations: No platforms declared in the project (unexpected state) combined with registry unavailability; broken platform versions in the BOM; network/proxy restrictions; corrupted caches holding stale platform metadata.

Related errors


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