{"record":{"id":"23cc697cec56f81b","repo":"quarkusio/quarkus","slug":"no-platforms-detected-in-the-project","errorCode":null,"errorMessage":"No platforms detected in the project","messagePattern":"No platforms detected in the project","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/GradleUtils.java","lineNumber":26,"sourceCode":"\nimport org.gradle.api.GradleException;\nimport org.gradle.api.Project;\nimport org.gradle.api.artifacts.Configuration;\nimport org.gradle.api.artifacts.Dependency;\nimport org.gradle.api.artifacts.ModuleDependency;\nimport org.gradle.api.attributes.Category;\nimport org.gradle.api.file.FileTree;\nimport org.gradle.api.plugins.JavaPlugin;\n\npublic class GradleUtils {\n\n    // Keep in sync with io.quarkus.devservices.deployment.compose.ComposeDevServicesProcessor\n    private static final Pattern COMPOSE_FILE = Pattern.compile(\"(^docker-compose|^compose)(-dev(-)?service).*.(yml|yaml)\");\n\n    public static String getQuarkusCoreVersion(Project project) {\n        final List<Dependency> bomDeps = listProjectBoms(project);\n        if (bomDeps.isEmpty()) {\n            throw new GradleException(\"No platforms detected in the project\");\n        }\n\n        final Configuration boms = project.getConfigurations()\n                .detachedConfiguration(bomDeps.toArray(new org.gradle.api.artifacts.Dependency[0]));\n\n        final AtomicReference<String> quarkusVersionRef = new AtomicReference<>();\n        boms.getResolutionStrategy().eachDependency(d -> {\n            if (quarkusVersionRef.get() == null && d.getTarget().getName().equals(\"quarkus-core\")\n                    && d.getTarget().getGroup().equals(\"io.quarkus\")) {\n                quarkusVersionRef.set(d.getTarget().getVersion());\n            }\n        });\n        boms.getResolvedConfiguration();\n        final String quarkusCoreVersion = quarkusVersionRef.get();\n        if (quarkusCoreVersion == null) {\n            throw new IllegalStateException(\"Failed to determine the Quarkus core version for the project\");\n        }\n        return quarkusCoreVersion;","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/GradleUtils.java#L8-L44","documentation":"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.","triggerScenarios":"Calling getQuarkusCoreVersion(project) on a project whose implementation configuration (including enforcedPlatform/platform declarations collected by listProjectBoms) contains no BOM dependencies.","commonSituations":"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.","solutions":["Add the Quarkus platform BOM: implementation enforcedPlatform(\"io.quarkus.platform:quarkus-bom:<version>\") to the project's dependencies","Call getQuarkusCoreVersion on the correct subproject that actually applies Quarkus","Check that the BOM is declared in the implementation configuration, not only custom configurations"],"exampleFix":"// before\ndependencies { implementation \"io.quarkus:quarkus-rest\" } // no platform\n// after\ndependencies {\n    implementation enforcedPlatform(\"io.quarkus.platform:quarkus-bom:3.x.y\")\n    implementation \"io.quarkus:quarkus-rest\"\n}","handlingStrategy":"validation","validationCode":"List<Dependency> boms = GradleUtils.listProjectBoms(project);\nif (boms.isEmpty()) { throw new IllegalStateException(\"Add a Quarkus platform BOM to build.gradle\"); }\nString v = GradleUtils.getQuarkusCoreVersion(project);","typeGuard":null,"tryCatchPattern":"try { v = GradleUtils.getQuarkusCoreVersion(project); } catch (GradleException e) { /* no platform BOM declared */ }","preventionTips":["Always import io.quarkus.platform:quarkus-bom via enforcedPlatform in implementation","Call the util on the subproject that applies Quarkus, not the root","Verify listProjectBoms(project) is non-empty before use"],"tags":["gradle","quarkus-platform","bom-missing"],"backgroundTag":"missing-platform-bom","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}