quarkusio/quarkus · error · IllegalStateException

Failed to determine the Quarkus core version for the project

Error message

Failed to determine the Quarkus core version for the project

What it means

quarkusCoreVersion() scans the resolved platform BOMs for the io.quarkus:quarkus-core dependency to learn the core version. If resolution succeeds but no quarkus-core version is found in any BOM, it throws IllegalStateException("Failed to determine the Quarkus core version for the project").

Source

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

        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;
    }

    protected QuarkusProject getQuarkusProject(boolean limitExtensionsToImportedPlatforms) {
        final GradleMessageWriter log = messageWriter();
        final ExtensionCatalog catalog = extensionsCatalog(limitExtensionsToImportedPlatforms, log);

        final Path projectDirPath = project.getProjectDir().toPath();
        final Path rootProjectPath = project.getParent() != null ? project.getRootProject().getProjectDir().toPath()
                : projectDirPath;
        final BuildFile buildFile;
        if (Files.exists(rootProjectPath.resolve("settings.gradle.kts"))
                && Files.exists(projectDirPath.resolve("build.gradle.kts"))) {
            buildFile = new GradleKotlinProjectBuildFile(project, catalog);
        } else if (Files.exists(rootProjectPath.resolve("settings.gradle"))
                && Files.exists(projectDirPath.resolve("build.gradle"))) {
            buildFile = new GradleGroovyProjectBuildFile(project, catalog);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure the official io.quarkus.platform:quarkus-bom is imported; it always declares quarkus-core.
  2. Clear the Gradle/Maven cache for the platform artifacts (rm -rf ~/.gradle/caches/modules-2) and re-resolve.
  3. Pin a matching quarkus plugin/platform version pair so the BOM contains quarkus-core.

Example fix

// before
implementation enforcedPlatform("com.example:custom-bom:1.0")

// after
implementation enforcedPlatform("io.quarkus.platform:quarkus-bom:3.15.1")
Defensive patterns

Strategy: validation

Validate before calling

// after resolution, confirm quarkus-core is on the platform-managed classpath
def core = configurations.implementation.resolvedConfiguration.firstLevelModuleDependencies.find { it.moduleGroup == 'io.quarkus' && it.moduleName == 'quarkus-core' }
assert core != null : 'quarkus-core not resolved from platform BOM'

Try / catch

try { quarkusCoreVersion() } catch (IllegalStateException e) { if (e.message.contains('Failed to determine the Quarkus core version')) { /* re-import official BOM, clean caches */ } }

Prevention

When it happens

Trigger: Platform BOMs exist but none contain io.quarkus:quarkus-core — e.g. an unrelated BOM only, a heavily filtered/custom platform BOM, or resolution configured to skip quarkus-core entries.

Common situations: Custom/trimmed enterprise platform BOMs; importing quarkus-bom with exclusion rules that drop quarkus-core; corrupted local Maven cache yielding an incomplete BOM resolution.

Related errors


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