quarkusio/quarkus · error · GradleException

Failed to import platform properties

Error message

Failed to import platform properties 

What it means

While building the application deployment classpath, Quarkus resolves the platform (BOM) artifact and imports its platform properties into the app model. If importing the properties file throws AppModelResolverException, the code wraps it in a GradleException identifying the platform properties file that failed. It signals that the Quarkus platform metadata could not be read from the resolved artifact.

Source

Thrown at devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java:240

                    final String name = identifier.getName();
                    if (name.endsWith(BootstrapConstants.PLATFORM_DESCRIPTOR_ARTIFACT_ID_SUFFIX)) {
                        platformDataDeps.add(toDependency(d.getTarget(), d.getTarget().getVersion(), "json"));
                        platformImports.addPlatformDescriptor(identifier.getGroup(), name, d.getTarget().getVersion(), "json",
                                d.getTarget().getVersion());
                    } else if (name.endsWith(BootstrapConstants.PLATFORM_PROPERTIES_ARTIFACT_ID_SUFFIX)) {
                        final Dependency gradleDep = toDependency(d.getTarget(), ArtifactCoords.DEFAULT_CLASSIFIER,
                                "properties");
                        platformDataDeps.add(gradleDep);

                        for (ResolvedArtifact a : project.getConfigurations().detachedConfiguration(gradleDep)
                                .getResolvedConfiguration().getResolvedArtifacts()) {
                            if (a.getName().equals(name)) {
                                try {
                                    platformImports.addPlatformProperties(identifier.getGroup(), name, null, "properties",
                                            d.getTarget().getVersion(),
                                            a.getFile().toPath());
                                } catch (AppModelResolverException e) {
                                    throw new GradleException("Failed to import platform properties " + a.getFile(), e);
                                }
                                break;
                            }
                        }
                    } else {
                        ArtifactKey artifactKey = ArtifactKey.ga(d.getTarget().getGroup(), name);
                        platformConstraints.computeIfAbsent(artifactKey,
                                k -> new PlatformSpec.Constraint(
                                        d.getTarget().getGroup(),
                                        name,
                                        d.getTarget().getVersion()));
                    }
                });
            });
        }
    }

    private static Dependency toDependency(ModuleVersionSelector versionSelector, String classifier, String type) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Clear the Gradle cache of the affected artifact (delete ~/.gradle/caches/modules-2 files for the platform coordinates or run ./gradlew --refresh-dependencies) and rebuild
  2. Verify the quarkus.platform.groupId/artifactId/version properties point to a real, published platform artifact
  3. Check file permissions/disk health for the file path named in the message
  4. If using SNAPSHOT platform versions, refresh or pin to a release

Example fix

// before (build.gradle)
implementation platform("io.quarkus:quarkus-bom:999-SNAPSHOT")
// after
implementation platform("io.quarkus:quarkus-bom:3.8.2")
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the platform artifact is resolvable and intact before relying on it
configurations.matching { it.name == 'quarkusPlatform' }.all {
    resolutionStrategy.failOnVersionConflict()
}
try {
    configurations.quarkusPlatform.resolve()
} catch (ResolveException e) {
    throw new GradleException("Quarkus platform artifact unresolvable: " + e.message, e)
}

Try / catch

try {
    project.evaluate()
} catch (GradleException e) {
    if (e.message?.startsWith('Failed to import platform properties')) {
        logger.error("Platform properties file broken: {} — run with --refresh-dependencies or fix cache", e.message)
    }
    throw e
}

Prevention

When it happens

Trigger: ApplicationDeploymentClasspathBuilder.setUpPlatformConfiguration finds the platform artifact and calls PlatformImports.addPlatformProperties; any AppModelResolverException (unreadable/corrupt/missing properties file, IO error) triggers this.

Common situations: Corrupted Gradle dependency cache containing a truncated properties file; a snapshot or overridden platform version whose properties file is missing; IDE-resolved artifacts pointing at stale files; disk/permission problems reading the artifact.

Related errors


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