quarkusio/quarkus · error · DeploymentInjectionException

Failed to resolve artifact

Error message

Failed to resolve artifact 

What it means

Thrown as a DeploymentInjectionException by resolve(Artifact, repos) when Maven Resolver's resolveArtifact call fails with an ArtifactResolutionException, i.e. the artifact file (JAR/POM) itself could not be downloaded from the local or remote repositories.

Source

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

        try {
            return resolver.getSystem().collectDependencies(resolver.getSession(), request).getRoot();
        } catch (DependencyCollectionException e) {
            throw new DeploymentInjectionException("Failed to collect dependencies for " + artifact, e);
        }
    }

    private Artifact resolve(Artifact artifact, List<RemoteRepository> repos) {
        if (artifact.getFile() != null) {
            return artifact;
        }
        try {
            return resolver.getSystem().resolveArtifact(resolver.getSession(),
                    new ArtifactRequest()
                            .setArtifact(artifact)
                            .setRepositories(repos))
                    .getArtifact();
        } catch (ArtifactResolutionException e) {
            throw new DeploymentInjectionException("Failed to resolve artifact " + artifact, e);
        }
    }

    private void setWalkingFlag(byte flag) {
        walkingFlags |= flag;
    }

    private boolean isWalkingFlagOn(byte flag) {
        return (walkingFlags & flag) == flag;
    }

    /**
     * Clears the flags and returns {@code true}, if the flags were actually on and cleared.
     *
     * @param flags the flags to clear
     * @return true if the flags were on and cleared, false if the flags were not on
     */
    private boolean clearWalkingFlag(byte flags) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Confirm the exact artifact exists in the target repository by browsing it (groupId/artifactId/version path)
  2. Fix credentials/proxy/mirror settings in settings.xml or bootstrap Maven config
  3. Delete a partially downloaded or checksum-failing entry in ~/.m2/repository and re-resolve with -U
  4. Run 'mvn dependency:get -Dartifact=g:a:v' to test downloadability independently of Quarkus
Defensive patterns

Strategy: validation

Validate before calling

// Probe artifact downloadability before invoking the resolver
// mvn dependency:get -Dartifact=com.acme:lib:1.0.0
boolean artifactExists(java.net.URL repo, String groupPath, String artifactId, String version, String ext) {
    try (var conn = (java.net.HttpURLConnection) java.net.URI.create(
            repo + groupPath + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + ext)
            .toURL().openConnection()) {
        return conn.getResponseCode() == 200;
    } catch (IOException e) { return false; }
}

Prevention

When it happens

Trigger: resolve() is called for deployment/descriptor artifacts during extension injection; the file does not exist in any configured repository, checksums fail, or network/auth prevents download.

Common situations: Artifact simply not published (wrong groupId/artifactId/version); private artifact not in the corporate mirror; expired credentials; checksum mismatch from a corrupted download; offline mode.

Related errors


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