quarkusio/quarkus · error · RuntimeException

did not resolve to any artifacts

Error message

 did not resolve to any artifacts

What it means

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.

Source

Thrown at devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/QuarkusComponentVariants.java:489

        for (var a : config.getResolvedConfiguration().getResolvedArtifacts()) {
            resolvedArtifact = a;
            break;
        }

        if (resolvedArtifact == null) {
            // likely a relocation artifact, in which case we want to resolve it with transitive deps and
            // take the first artifact.
            resolvedArtifact = tryResolvingRelocationArtifact(dep);
        }

        if (resolvedArtifact == null) {
            // check if that's due to exclude rules, and if yes, ignore
            if (isExplicitlyExcluded(dep)) {
                project.getLogger().info("Conditional dependency {} ignored due to exclusion rule", dep);
                return null;
            }
            throw new RuntimeException(dep + " did not resolve to any artifacts");
        }

        return new ConditionalDependency(
                getKey(resolvedArtifact),
                resolvedArtifact,
                DependencyUtils.getExtensionInfoOrNull(project, resolvedArtifact));

    }

    private boolean isExplicitlyExcluded(Dependency dep) {
        return platformSpecProperty.get().getExclusions().stream().anyMatch(rule -> {
            // Do not abort if the group is null, allow the next comparison to take place
            if (rule.getGroup() != null && !Objects.equals(rule.getGroup(), dep.getGroup())) {
                return false;
            }
            // If we reached this point, and module of the rule is null, it is a match
            return rule.getModule() == null || Objects.equals(rule.getModule(), dep.getName());
        });

View on GitHub (pinned to e1c734241f)

Solutions

  1. Run ./gradlew build --refresh-dependencies to force clean re-resolution
  2. Check repositories configuration so all needed modules (and the Quarkus platform repos) are reachable
  3. Inspect why the named dependency is in the graph (dependency insight) and exclude it if it is not needed
  4. Clear the Gradle cache for the failing module in case of a corrupted cache entry

Example fix

// before
implementation("io.quarkus:quarkus-some-extension:3.8.2")
// after — exclude the problematic transitive conditional dep
implementation("io.quarkus:quarkus-some-extension:3.8.2") {
    exclude(group = "io.quarkus", module = "quarkus-broken-module")
}
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the dependency resolves before relying on conditional extension wiring
def cfg = configurations.detachedConfiguration(
    dependencies.create("io.quarkus:quarkus-some-extension:<version>"))
try {
    cfg.resolvedConfiguration.lenientConfiguration.allModuleDependencies
} catch (Exception e) {
    throw new GradleException("Dependency does not resolve: check repositories and coordinates", e)
}

Try / catch

try {
    project.evaluate()
} catch (RuntimeException e) {
    if (e.message?.endsWith('did not resolve to any artifacts')) {
        logger.warn("Broken conditional dependency: {} — add an exclude or fix repositories", e.message)
    }
    throw e
}

Prevention

When it happens

Trigger: QuarkusComponentVariants.getOrCreateConditionalDep -> newConditionalDep resolves a conditional dependency whose ResolvedArtifactResult is null and which is not covered by isExplicitlyExcluded.

Common situations: 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.

Related errors


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