{"record":{"id":"84fc956df1272a14","repo":"quarkusio/quarkus","slug":"failed-to-read-descriptor-of-artifact-84fc95","errorCode":null,"errorMessage":"Failed to read descriptor of ${artifact}","messagePattern":"Failed to read descriptor of (.+?)","errorType":"exception","errorClass":"BootstrapMavenException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java","lineNumber":199,"sourceCode":"            throws BootstrapMavenException {\n        return resolveDescriptorInternal(artifact, remoteRepos);\n    }\n\n    public ArtifactDescriptorResult resolveDescriptor(final Artifact artifact, List<RemoteRepository> mainRepos)\n            throws BootstrapMavenException {\n        return resolveDescriptorInternal(artifact, aggregateRepositories(mainRepos, remoteRepos));\n    }\n\n    private ArtifactDescriptorResult resolveDescriptorInternal(final Artifact artifact, List<RemoteRepository> aggregatedRepos)\n            throws BootstrapMavenException {\n        try {\n            return repoSystem.readArtifactDescriptor(repoSession,\n                    new ArtifactDescriptorRequest()\n                            .setArtifact(artifact)\n                            .setRepositories(\n                                    aggregatedRepos));\n        } catch (ArtifactDescriptorException e) {\n            throw new BootstrapMavenException(\"Failed to read descriptor of \" + artifact, e);\n        }\n    }\n\n    public VersionRangeResult resolveVersionRange(Artifact artifact) throws BootstrapMavenException {\n        try {\n            return repoSystem.resolveVersionRange(repoSession,\n                    new VersionRangeRequest()\n                            .setArtifact(artifact)\n                            .setRepositories(remoteRepos));\n        } catch (VersionRangeResolutionException ex) {\n            throw new BootstrapMavenException(\"Failed to resolve version range for \" + artifact, ex);\n        }\n    }\n\n    public String getLatestVersionFromRange(Artifact artifact, String range) throws BootstrapMavenException {\n        return getLatest(resolveVersionRange(new DefaultArtifact(artifact.getGroupId(), artifact.getArtifactId(),\n                artifact.getClassifier(), artifact.getExtension(), range)));\n    }","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java#L181-L217","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the cause ArtifactDescriptorException for the underlying missing/invalid POM","Delete the artifact's directory in ~/.m2/repository and re-resolve to replace corrupt metadata","Confirm the GAV exists (browsing Maven Central) and the version is correct","Verify repository connectivity/proxy configuration"],"exampleFix":"// before\nresolver.resolveDescriptor(new DefaultArtifact(\"com.acme\", \"tool\", null, \"jar\", \"1.0\"));\n// after: verify first\nString v = resolver.resolveVersionRange(new DefaultArtifact(\"com.acme\", \"tool\", null, \"jar\", \"[1.0,)\"))\n           .getHighestVersion() != null ? \"1.0\" : null;\nif (v != null) resolver.resolveDescriptor(new DefaultArtifact(\"com.acme\", \"tool\", null, \"jar\", v));","handlingStrategy":"validation","validationCode":"// pre-check: the POM must be resolvable before reading its descriptor\ntry {\n    resolver.resolve(new DefaultArtifact(g, a, null, \"pom\", v));\n} catch (BootstrapMavenException e) {\n    throw new IllegalStateException(\"POM not resolvable for \" + g + \":\" + a + \":\" + v, e);\n}","typeGuard":"boolean descriptorLikelyReadable(MavenArtifactResolver r, Artifact a) {\n    try { r.resolveVersionRange(new DefaultArtifact(a.getGroupId(), a.getArtifactId(), null, a.getExtension(), \"[0,)\")); return true; }\n    catch (BootstrapMavenException e) { return false; }\n}","tryCatchPattern":"try {\n    ArtifactDescriptorResult d = resolver.resolveDescriptor(artifact);\n} catch (BootstrapMavenException e) {\n    if (e.getCause() instanceof ArtifactDescriptorException ade)\n        log.error(\"Descriptor unreadable: \" + ade.getMessage());\n}","preventionTips":["Clear corrupt ~/.m2 entries when descriptor errors repeat for the same artifact","Confirm the artifact actually publishes a POM (some artifacts are metadata-less)","Check repository connectivity before large resolution runs","Pin exact versions rather than ranges that may resolve to nonexistent versions"],"tags":["maven","descriptor","pom"],"backgroundTag":"artifact-descriptor-read-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}