{"record":{"id":"bf5f214ab98dc179","repo":"quarkusio/quarkus","slug":"did-not-resolve-to-any-artifacts","errorCode":null,"errorMessage":" did not resolve to any artifacts","messagePattern":" did not resolve to any artifacts","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/QuarkusComponentVariants.java","lineNumber":489,"sourceCode":"\n        for (var a : config.getResolvedConfiguration().getResolvedArtifacts()) {\n            resolvedArtifact = a;\n            break;\n        }\n\n        if (resolvedArtifact == null) {\n            // likely a relocation artifact, in which case we want to resolve it with transitive deps and\n            // take the first artifact.\n            resolvedArtifact = tryResolvingRelocationArtifact(dep);\n        }\n\n        if (resolvedArtifact == null) {\n            // check if that's due to exclude rules, and if yes, ignore\n            if (isExplicitlyExcluded(dep)) {\n                project.getLogger().info(\"Conditional dependency {} ignored due to exclusion rule\", dep);\n                return null;\n            }\n            throw new RuntimeException(dep + \" did not resolve to any artifacts\");\n        }\n\n        return new ConditionalDependency(\n                getKey(resolvedArtifact),\n                resolvedArtifact,\n                DependencyUtils.getExtensionInfoOrNull(project, resolvedArtifact));\n\n    }\n\n    private boolean isExplicitlyExcluded(Dependency dep) {\n        return platformSpecProperty.get().getExclusions().stream().anyMatch(rule -> {\n            // Do not abort if the group is null, allow the next comparison to take place\n            if (rule.getGroup() != null && !Objects.equals(rule.getGroup(), dep.getGroup())) {\n                return false;\n            }\n            // If we reached this point, and module of the rule is null, it is a match\n            return rule.getModule() == null || Objects.equals(rule.getModule(), dep.getName());\n        });","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/QuarkusComponentVariants.java#L471-L507","documentation":"Quarkus's Gradle component metadata rule creates conditional dependencies (e.g. optional extensions pulled in transitively) and resolves them immediately. If Gradle returns no artifact for the dependency and it is not explained by an explicit exclusion rule, Quarkus throws a RuntimeException stating the dependency did not resolve to any artifacts. This is a dependency-resolution failure, not an application error.","triggerScenarios":"QuarkusComponentVariants.getOrCreateConditionalDep -> newConditionalDep resolves a conditional dependency whose ResolvedArtifactResult is null and which is not covered by isExplicitlyExcluded.","commonSituations":"Broken or partially-populated Gradle dependency graph (failed earlier resolution steps); repository misconfiguration where a module's artifacts are unavailable; version conflicts/relocations leaving the target module empty; offline mode hiding published artifacts.","solutions":["Run ./gradlew build --refresh-dependencies to force clean re-resolution","Check repositories configuration so all needed modules (and the Quarkus platform repos) are reachable","Inspect why the named dependency is in the graph (dependency insight) and exclude it if it is not needed","Clear the Gradle cache for the failing module in case of a corrupted cache entry"],"exampleFix":"// before\nimplementation(\"io.quarkus:quarkus-some-extension:3.8.2\")\n// after — exclude the problematic transitive conditional dep\nimplementation(\"io.quarkus:quarkus-some-extension:3.8.2\") {\n    exclude(group = \"io.quarkus\", module = \"quarkus-broken-module\")\n}","handlingStrategy":"try-catch","validationCode":"// verify the dependency resolves before relying on conditional extension wiring\ndef cfg = configurations.detachedConfiguration(\n    dependencies.create(\"io.quarkus:quarkus-some-extension:<version>\"))\ntry {\n    cfg.resolvedConfiguration.lenientConfiguration.allModuleDependencies\n} catch (Exception e) {\n    throw new GradleException(\"Dependency does not resolve: check repositories and coordinates\", e)\n}","typeGuard":null,"tryCatchPattern":"try {\n    project.evaluate()\n} catch (RuntimeException e) {\n    if (e.message?.endsWith('did not resolve to any artifacts')) {\n        logger.warn(\"Broken conditional dependency: {} — add an exclude or fix repositories\", e.message)\n    }\n    throw e\n}","preventionTips":["Keep repositories configuration complete (Maven Central + Quarkus platform repos)","Run ./gradlew dependencyInsight --dependency <module> to inspect broken graph entries","Exclude unneeded transitive extension dependencies explicitly","Avoid mixing BOM versions that relocate or omit modules"],"tags":["gradle","dependency-resolution","conditional-dependency"],"backgroundTag":"dependency-did-not-resolve","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"}