{"record":{"id":"1b34ca6d682895d9","repo":"quarkusio/quarkus","slug":"failed-to-add-platform-properties-artifact","errorCode":null,"errorMessage":"Failed to add platform properties + artifact","messagePattern":"Failed to add platform properties \\+ artifact","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusApplicationModelTask.java","lineNumber":587,"sourceCode":"         * Internal since we track defined dependencies via {@link QuarkusApplicationModelTask#getOriginalClasspath}\n         */\n        @Internal\n        public abstract Property<ArtifactCollection> getResolvedArtifactCollection();\n\n        private PlatformImportsImpl resolvePlatformImports() {\n            final PlatformImportsImpl result = new PlatformImportsImpl();\n            for (var artifact : getResolvedArtifactCollection().get().getArtifacts()) {\n                var compId = ((ModuleComponentArtifactIdentifier) artifact.getId()).getComponentIdentifier();\n                final String artifactId = artifact.getFile().getName();\n                if (artifactId.endsWith(\".json\")) {\n                    result.addPlatformDescriptor(compId.getGroup(), compId.getModuleIdentifier().getName(), compId.getVersion(),\n                            \"json\", compId.getVersion());\n                } else if (artifactId.endsWith(\".properties\")) {\n                    try {\n                        result.addPlatformProperties(compId.getGroup(), compId.getModuleIdentifier().getName(),\n                                ArtifactCoords.DEFAULT_CLASSIFIER, \"json\", compId.getVersion(), artifact.getFile().toPath());\n                    } catch (AppModelResolverException e) {\n                        throw new RuntimeException(\"Failed to add platform properties \" + artifact, e);\n                    }\n                }\n            }\n            return result;\n        }\n\n        public void configureFrom(Configuration configuration) {\n            getResolvedArtifactCollection().set(configuration.getIncoming().getArtifacts());\n        }\n    }\n\n    /**\n     * See example https://docs.gradle.org/current/samples/sample_tasks_with_dependency_resolution_result_inputs.html,\n     * to better understand how this works.\n     */\n    public static abstract class QuarkusResolvedClasspath {\n\n        /**","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusApplicationModelTask.java#L569-L605","documentation":"Thrown by QuarkusApplicationModelTask.resolvePlatformImports() when a platform artifact ending in '.properties' cannot be registered as platform properties in the application model (AppModelResolverException wrapped in RuntimeException). It indicates a corrupted or unreadable platform descriptor artifact in the local/remote repository.","triggerScenarios":"Resolving the Quarkus platform (BOM) during quarkusApplicationModel computation where a quarkus-*-properties artifact's file exists but cannot be added (invalid path, unreadable/corrupt artifact file in ~/.m2 or Gradle cache).","commonSituations":"Corrupted Gradle/Maven cache after interrupted downloads; mismatched platform versions where a properties artifact is stale; running behind proxies leaving partially downloaded artifacts.","solutions":["Delete the offending artifact from the Gradle cache (~/.gradle/caches/modules-2) and re-run to re-download","Run with --refresh-dependencies to force re-resolution of platform artifacts","Check disk permissions and available space; verify platform BOM versions align with the Quarkus version"],"exampleFix":"// before: corrupted artifact\nrm -rf ~/.gradle/caches/modules-2/files-2.1/io.quarkus.platform/\n./gradlew quarkusBuild --refresh-dependencies","handlingStrategy":"retry","validationCode":"// verify the platform properties artifact is readable before building\nval f = File(path)\nif (!f.isFile || f.length() == 0L) throw IllegalStateException(\"Corrupt artifact: $f\")","typeGuard":null,"tryCatchPattern":"try { resolvePlatformImports() } catch (e: RuntimeException) {\n  if (e.message?.startsWith(\"Failed to add platform properties\") == true) {\n    // purge the artifact from ~/.gradle/caches and retry with --refresh-dependencies\n  } else throw e\n}","preventionTips":["Avoid interrupted downloads (use stable network/repo mirrors in CI)","Clean Gradle caches periodically","Keep Quarkus platform BOM versions aligned with the Quarkus version"],"tags":["gradle","maven-resolver","platform","application-model"],"backgroundTag":"artifact-resolution-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}