quarkusio/quarkus · error · GradleException

No platforms detected in the project

Error message

No platforms detected in the project

What it means

GradleUtils.getQuarkusCoreVersion throws GradleException when the project declares no BOM dependencies at all — meaning no Quarkus platform BOM (e.g. io.quarkus.platform:quarkus-bom) was detected via listProjectBoms.

Source

Thrown at devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/GradleUtils.java:26

import org.gradle.api.GradleException;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.artifacts.ModuleDependency;
import org.gradle.api.attributes.Category;
import org.gradle.api.file.FileTree;
import org.gradle.api.plugins.JavaPlugin;

public class GradleUtils {

    // Keep in sync with io.quarkus.devservices.deployment.compose.ComposeDevServicesProcessor
    private static final Pattern COMPOSE_FILE = Pattern.compile("(^docker-compose|^compose)(-dev(-)?service).*.(yml|yaml)");

    public static String getQuarkusCoreVersion(Project project) {
        final List<Dependency> bomDeps = listProjectBoms(project);
        if (bomDeps.isEmpty()) {
            throw new GradleException("No platforms detected in the project");
        }

        final Configuration boms = project.getConfigurations()
                .detachedConfiguration(bomDeps.toArray(new org.gradle.api.artifacts.Dependency[0]));

        final AtomicReference<String> quarkusVersionRef = new AtomicReference<>();
        boms.getResolutionStrategy().eachDependency(d -> {
            if (quarkusVersionRef.get() == null && d.getTarget().getName().equals("quarkus-core")
                    && d.getTarget().getGroup().equals("io.quarkus")) {
                quarkusVersionRef.set(d.getTarget().getVersion());
            }
        });
        boms.getResolvedConfiguration();
        final String quarkusCoreVersion = quarkusVersionRef.get();
        if (quarkusCoreVersion == null) {
            throw new IllegalStateException("Failed to determine the Quarkus core version for the project");
        }
        return quarkusCoreVersion;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add the Quarkus platform BOM: implementation enforcedPlatform("io.quarkus.platform:quarkus-bom:<version>") to the project's dependencies
  2. Call getQuarkusCoreVersion on the correct subproject that actually applies Quarkus
  3. Check that the BOM is declared in the implementation configuration, not only custom configurations

Example fix

// before
dependencies { implementation "io.quarkus:quarkus-rest" } // no platform
// after
dependencies {
    implementation enforcedPlatform("io.quarkus.platform:quarkus-bom:3.x.y")
    implementation "io.quarkus:quarkus-rest"
}
Defensive patterns

Strategy: validation

Validate before calling

List<Dependency> boms = GradleUtils.listProjectBoms(project);
if (boms.isEmpty()) { throw new IllegalStateException("Add a Quarkus platform BOM to build.gradle"); }
String v = GradleUtils.getQuarkusCoreVersion(project);

Try / catch

try { v = GradleUtils.getQuarkusCoreVersion(project); } catch (GradleException e) { /* no platform BOM declared */ }

Prevention

When it happens

Trigger: Calling getQuarkusCoreVersion(project) on a project whose implementation configuration (including enforcedPlatform/platform declarations collected by listProjectBoms) contains no BOM dependencies.

Common situations: build.gradle missing `enforcedPlatform("io.quarkus.platform:quarkus-bom:...")` / `platform(...)`; version catalog or centralized repository declarations invisible to the implementation configuration; calling the util on the root project instead of a subproject.

Related errors


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