quarkusio/quarkus · critical · BootstrapMavenException

Failed to resolve dependencies for

Error message

Failed to resolve dependencies for 

What it means

Thrown as a BootstrapMavenException by resolveRuntimeDeps when Maven Resolver's resolveDependencies call fails with a DependencyResolutionException while resolving the application's runtime dependency tree. The root artifact that could not be resolved is included in the message; the cause chain contains Maven's per-artifact failure details (missing artifacts, repository errors, conflicts).

Source

Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyTreeResolver.java:426

                    }
                    final Set<ArtifactKey> deps = artifactDeps
                            .computeIfAbsent(DependencyUtils.getCoords(node.getArtifact()),
                                    k -> new HashSet<>(node.getChildren().size()));
                    for (DependencyNode c : node.getChildren()) {
                        deps.add(getKey(c.getArtifact()));
                        walk(c, visited);
                    }
                }
            });
            session = mutableSession;
        }
        try {
            return resolver.getSystem().resolveDependencies(session,
                    new DependencyRequest().setCollectRequest(request))
                    .getRoot();
        } catch (DependencyResolutionException e) {
            final Artifact a = request.getRoot() == null ? request.getRootArtifact() : request.getRoot().getArtifact();
            throw new BootstrapMavenException("Failed to resolve dependencies for " + a, e);
        }
    }

    private boolean isRuntimeArtifact(ArtifactKey key) {
        final ResolvedDependencyBuilder dep = appBuilder.getDependency(key);
        return dep != null && dep.isFlagSet(DependencyFlags.RUNTIME_CP);
    }

    private void visitRuntimeDependencies(List<DependencyNode> list) {
        for (DependencyNode n : list) {
            visitRuntimeDependency(n);
        }
    }

    private void visitRuntimeDependency(DependencyNode node) {

        final byte prevWalkingFlags = walkingFlags;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the cause chain to find the exact missing/unresolvable artifact, then run 'mvn dependency:resolve -U' in the project to confirm and refresh
  2. Check the artifact version exists in the repositories (typos, removed SNAPSHOTs); pin a released version or deploy the artifact
  3. Verify repositories are reachable: check settings.xml mirrors/auth, corporate proxy, or add the missing <repository> to the POM or quarkus bootstrap config
  4. If the local repo copy is corrupt, delete the artifact's directory under ~/.m2/repository and re-resolve
  5. If network is unavailable intentionally, run with offline mode and ensure all artifacts are pre-populated

Example fix

// before: unresolvable version
<dependency>
  <groupId>com.acme</groupId>
  <artifactId>lib</artifactId>
  <version>2.0.0-SNAPSHOT</version>
</dependency>
// after: pin an existing released version
<version>1.9.3</version>
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check resolvability with plain Maven before running the app
// mvn -U dependency:resolve  (or dependency:get -Dartifact=g:a:v)
// Also verify offline artifacts exist:
import java.nio.file.*;
boolean inLocalRepo(String groupId, String artifactId, String version, String ext) {
    Path p = Path.of(System.getProperty("user.home"), ".m2", "repository",
        groupId.replace('.', '/'), artifactId, version, artifactId + "-" + version + "." + ext);
    return Files.exists(p);
}

Try / catch

try {
    appModel = resolver.resolve();
} catch (BootstrapMavenException e) {
    // inspect e.getCause() (DependencyResolutionException) for the exact missing artifact
    log.error("Unresolvable runtime dependencies; check repos/settings.xml: " + e.getCause(), e);
    throw e;
}

Prevention

When it happens

Trigger: Calling ApplicationDependencyTreeResolver.resolve() when a runtime dependency (transitively included) cannot be downloaded from configured repositories, a dependency POM/JAR is missing or corrupted in the local repo, or repository access fails (offline, auth, network).

Common situations: Corporate proxy/firewall blocking repo access; typo'd or unpublished version (e.g. SNAPSHOT purged); missing repository declaration for a private artifact; corrupt ~/.m2/repository entries; using quarkus.bootstrap.offline without a pre-populated local repo.

Related errors


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