{"record":{"id":"19ea07ed5bac2a2c","repo":"apache/maven","slug":"failed-to-retrieve-pom-for-artifact-getid","errorCode":null,"errorMessage":"Failed to retrieve POM for \" + artifact.getId() + \": \" + e.getCause().getMessage()","messagePattern":"Failed to retrieve POM for \" \\+ artifact\\.getId\\(\\) \\+ \": \" \\+ e\\.getCause\\(\\)\\.getMessage\\(\\)","errorType":"exception","errorClass":"ArtifactMetadataRetrievalException","httpStatus":null,"severity":"error","filePath":"compat/maven-compat/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java","lineNumber":567,"sourceCode":"                    }\n                    configuration.setRepositorySession(legacySupport.getRepositorySession());\n\n                    project = projectBuilder.build(pomArtifact, configuration).getProject();\n                } catch (ProjectBuildingException e) {\n                    ModelProblem missingParentPom = hasMissingParentPom(e);\n                    if (missingParentPom != null) {\n                        throw new ArtifactMetadataRetrievalException(\n                                \"Failed to process POM for \" + artifact.getId() + \": \" + missingParentPom.getMessage(),\n                                missingParentPom.getException(),\n                                artifact);\n                    }\n\n                    String message;\n\n                    if (isMissingPom(e)) {\n                        message = \"Missing POM for \" + artifact.getId();\n                    } else if (isNonTransferablePom(e)) {\n                        throw new ArtifactMetadataRetrievalException(\n                                \"Failed to retrieve POM for \" + artifact.getId() + \": \"\n                                        + e.getCause().getMessage(),\n                                e.getCause(),\n                                artifact);\n                    } else {\n                        message = \"Invalid POM for \" + artifact.getId()\n                                + \", transitive dependencies (if any) will not be available\"\n                                + \", enable verbose output (-X) for more details\";\n                    }\n\n                    if (logger.isDebugEnabled()) {\n                        message += \": \" + e.getMessage();\n                    }\n\n                    logger.warn(message);\n                }\n\n                if (project != null) {","sourceCodeStart":549,"sourceCodeEnd":585,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java#L549-L585","documentation":"Thrown by MavenMetadataSource when building the POM of an artifact fails with a non-transferable-POM condition: the POM exists in the repository but the transfer itself failed. isNonTransferablePom(e) detects that shape and the ArtifactMetadataRetrievalException is built from e.getCause() (typically a Wagon/resolver transfer error: connection, authentication, authorization or checksum failure), so the original network-level message surfaces.","triggerScenarios":"retrieve() fetches artifact X's POM; projectBuilder.build fails; the failure is classified as a transfer problem (HTTP 401/403/404-with-mirror-replay, connection refused, timeout, checksum mismatch) rather than a missing or malformed POM.","commonSituations":"Private repos requiring auth where credentials are missing in settings.xml; flaky networks/proxies interrupting POM download; Nexus/Artifactory returning 401 for unauthorized groups; snapshots where the POM was purged mid-transfer; mirrors (e.g. '*' mirrorOf to a repo lacking the artifact) causing download errors.","solutions":["Check the cause message for the HTTP/status error and fix the corresponding issue (credentials, proxy, URL)","Add/fix <server> credentials in settings.xml for the repository id shown in logs","Whitelist the needed repo from catch-all mirrors (mirrorOf '*,!corp-repo')","Retry after deleting the failed artifact's folder under ~/.m2/repository; use -U to force update checks","If behind a proxy, configure <proxies> in settings.xml or corporate environment variables"],"exampleFix":"# before: mirror intercepts everything and rejects\n<mirror><id>all</id><mirrorOf>*</mirrorOf><url>https://mirror.example/repo</url></mirror>\n# after: exempt the private repo\n<mirror><id>all</id><mirrorOf>*,!corp-releases</mirrorOf><url>https://mirror.example/repo</url></mirror>","handlingStrategy":"retry","validationCode":"// Verify reachability/credentials of a private repo before building\n// curl -fsSL -u \"$USER:$PASS\" <repoUrl>/<knownPath> > /dev/null || fail \"repo auth/broken\"","typeGuard":null,"tryCatchPattern":"try {\n    retrieve(artifact, ...);\n} catch (ArtifactMetadataRetrievalException e) {\n    if (e.getCause() instanceof org.apache.maven.wagon.TransferFailedException) {\n        // transient network/auth: back off and retry once, then surface cause\n    }\n}","preventionTips":["Keep <server> credentials in settings.xml in sync with repo ids","Scope mirrors precisely (mirrorOf '*,!private-repo')","Retry with -U after fixing credentials; stale failure state otherwise replays"],"tags":["maven","pom","transfer","network","authentication","resolution"],"backgroundTag":"artifact-download-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}