{"record":{"id":"64f58b45ec620b96","repo":"quarkusio/quarkus","slug":"failed-to-read-descriptor-of-artifact","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/BootstrapAppModelResolver.java","lineNumber":630,"sourceCode":"        try {\n            return mvn.getSystem().resolveArtifact(mvn.getSession(),\n                    new ArtifactRequest()\n                            .setArtifact(artifact)\n                            .setRepositories(aggregatedRepos));\n        } catch (ArtifactResolutionException e) {\n            throw new BootstrapMavenException(\"Failed to resolve artifact \" + artifact, e);\n        }\n    }\n\n    private ArtifactDescriptorResult resolveDescriptor(Artifact artifact, List<RemoteRepository> aggregatedRepos)\n            throws BootstrapMavenException {\n        try {\n            return mvn.getSystem().readArtifactDescriptor(mvn.getSession(),\n                    new ArtifactDescriptorRequest()\n                            .setArtifact(artifact)\n                            .setRepositories(aggregatedRepos));\n        } catch (ArtifactDescriptorException e) {\n            throw new BootstrapMavenException(\"Failed to read descriptor of \" + artifact, e);\n        }\n    }\n}\n","sourceCodeStart":612,"sourceCodeEnd":634,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/BootstrapAppModelResolver.java#L612-L634","documentation":"resolveDescriptor reads an artifact's POM descriptor via the Maven Resolver. If ArtifactDescriptorException is thrown (POM unreadable, unresolvable parents, invalid model), it is wrapped as BootstrapMavenException \"Failed to read descriptor of <artifact>\".","triggerScenarios":"resolveDescriptor(Artifact, List<RemoteRepository>) (called from appArtifactDescr during doResolveModel) when readArtifactDescriptor fails — invalid/corrupt POM in the local repo, unresolvable parent POM, or a non-POM artifact where a descriptor is expected.","commonSituations":"Corrupted cached POM under ~/.m2/repository (partial download); parent POM version that no longer exists remotely; custom artifacts published without valid POMs.","solutions":["Delete the artifact's directory under ~/.m2/repository and re-resolve to repair a corrupt cached POM.","Check the wrapped cause for an unresolvable parent POM and fix the parent's coordinates/availability.","Verify the remote repository serving the POM is reachable and contains the correct version."],"exampleFix":"// before\nrm nothing; keep corrupt cache\n// after\nrm -rf ~/.m2/repository/com/example/broken-artifact/1.0.0 && mvn -U quarkus:dev","handlingStrategy":"try-catch","validationCode":"// Detect likely-corrupt cached POM before resolution:\nPath pom = localRepo.resolve(groupId.replace('.', '/') + \"/\" + artifactId + \"/\" + version + \"/\"\n    + artifactId + \"-\" + version + \".pom\");\nif (Files.exists(pom) && Files.size(pom) == 0) {\n    Files.delete(pom); // remove empty/corrupt POM\n}","typeGuard":"static boolean hasReadablePom(java.nio.file.Path localRepoPath, String gavPath) {\n    java.nio.file.Path p = localRepoPath.resolve(gavPath);\n    return java.nio.file.Files.isRegularFile(p) && p.toFile().length() > 0;\n}","tryCatchPattern":"try {\n    model = resolver.resolveModel(coords);\n} catch (BootstrapMavenException e) {\n    if (e.getMessage().startsWith(\"Failed to read descriptor\")) {\n        log.error(\"POM descriptor unreadable; clear the artifact from ~/.m2/repository and retry: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Treat zero-length POMs in ~/.m2/repository as corrupt and delete them.","Keep parent POM versions available in configured repositories.","Use -U to force refresh of stale metadata after upstream releases."],"tags":["maven","pom","descriptor","corrupt-cache"],"backgroundTag":"pom-unreadable","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}