quarkusio/quarkus · error · BootstrapMavenException

Failed to read descriptor of ${artifact}

Error message

Failed to read descriptor of ${artifact}

What it means

resolveDescriptorInternal reads an artifact's Maven descriptor (its POM metadata) via Aether's readArtifactDescriptor. Failure (ArtifactDescriptorException) — typically the POM itself cannot be resolved or is invalid — is wrapped as 'Failed to read descriptor of <gav>'. This precedes dependency collection, so it usually means the artifact's POM is missing or broken.

Source

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

            throws BootstrapMavenException {
        return resolveDescriptorInternal(artifact, remoteRepos);
    }

    public ArtifactDescriptorResult resolveDescriptor(final Artifact artifact, List<RemoteRepository> mainRepos)
            throws BootstrapMavenException {
        return resolveDescriptorInternal(artifact, aggregateRepositories(mainRepos, remoteRepos));
    }

    private ArtifactDescriptorResult resolveDescriptorInternal(final Artifact artifact, List<RemoteRepository> aggregatedRepos)
            throws BootstrapMavenException {
        try {
            return repoSystem.readArtifactDescriptor(repoSession,
                    new ArtifactDescriptorRequest()
                            .setArtifact(artifact)
                            .setRepositories(
                                    aggregatedRepos));
        } catch (ArtifactDescriptorException e) {
            throw new BootstrapMavenException("Failed to read descriptor of " + artifact, e);
        }
    }

    public VersionRangeResult resolveVersionRange(Artifact artifact) throws BootstrapMavenException {
        try {
            return repoSystem.resolveVersionRange(repoSession,
                    new VersionRangeRequest()
                            .setArtifact(artifact)
                            .setRepositories(remoteRepos));
        } catch (VersionRangeResolutionException ex) {
            throw new BootstrapMavenException("Failed to resolve version range for " + artifact, ex);
        }
    }

    public String getLatestVersionFromRange(Artifact artifact, String range) throws BootstrapMavenException {
        return getLatest(resolveVersionRange(new DefaultArtifact(artifact.getGroupId(), artifact.getArtifactId(),
                artifact.getClassifier(), artifact.getExtension(), range)));
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Check the cause ArtifactDescriptorException for the underlying missing/invalid POM
  2. Delete the artifact's directory in ~/.m2/repository and re-resolve to replace corrupt metadata
  3. Confirm the GAV exists (browsing Maven Central) and the version is correct
  4. Verify repository connectivity/proxy configuration

Example fix

// before
resolver.resolveDescriptor(new DefaultArtifact("com.acme", "tool", null, "jar", "1.0"));
// after: verify first
String v = resolver.resolveVersionRange(new DefaultArtifact("com.acme", "tool", null, "jar", "[1.0,)"))
           .getHighestVersion() != null ? "1.0" : null;
if (v != null) resolver.resolveDescriptor(new DefaultArtifact("com.acme", "tool", null, "jar", v));
Defensive patterns

Strategy: validation

Validate before calling

// pre-check: the POM must be resolvable before reading its descriptor
try {
    resolver.resolve(new DefaultArtifact(g, a, null, "pom", v));
} catch (BootstrapMavenException e) {
    throw new IllegalStateException("POM not resolvable for " + g + ":" + a + ":" + v, e);
}

Type guard

boolean descriptorLikelyReadable(MavenArtifactResolver r, Artifact a) {
    try { r.resolveVersionRange(new DefaultArtifact(a.getGroupId(), a.getArtifactId(), null, a.getExtension(), "[0,)")); return true; }
    catch (BootstrapMavenException e) { return false; }
}

Try / catch

try {
    ArtifactDescriptorResult d = resolver.resolveDescriptor(artifact);
} catch (BootstrapMavenException e) {
    if (e.getCause() instanceof ArtifactDescriptorException ade)
        log.error("Descriptor unreadable: " + ade.getMessage());
}

Prevention

When it happens

Trigger: Calling resolveDescriptor(Artifact) for an artifact whose POM cannot be fetched from local/remote repositories, or whose POM is invalid/corrupt so the descriptor cannot be parsed.

Common situations: Artifact exists as a JAR but has no/invalid POM in the repo; local repo has a corrupt POM from an interrupted download; artifact version doesn't actually exist; network outage while fetching the POM.

Related errors


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