{"record":{"id":"0b9cb1aa7759ba88","repo":"apache/maven","slug":"unable-to-get-dependency-information-for-artif","errorCode":null,"errorMessage":"Unable to get dependency information for \" + artifact.getId() + \": \" + e.getMessage()","messagePattern":"Unable to get dependency information for \" \\+ artifact\\.getId\\(\\) \\+ \": \" \\+ e\\.getMessage\\(\\)","errorType":"exception","errorClass":"ArtifactResolutionException","httpStatus":null,"severity":"error","filePath":"compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java","lineNumber":533,"sourceCode":"                            if (rGroup == null) {\n                                // relocated dependency artifact is declared excluded, no need to add and recurse\n                                // further\n                                continue;\n                            }\n\n                            child.addDependencies(rGroup.getArtifacts(), rGroup.getResolutionRepositories(), filter);\n\n                        } catch (CyclicDependencyException e) {\n                            // would like to throw this, but we have crappy stuff in the repo\n\n                            fireEvent(\n                                    ResolutionListener.OMIT_FOR_CYCLE,\n                                    listeners,\n                                    new ResolutionNode(e.getArtifact(), childRemoteRepositories, child));\n                        } catch (ArtifactMetadataRetrievalException e) {\n                            artifact.setDependencyTrail(node.getDependencyTrail());\n\n                            throw new ArtifactResolutionException(\n                                    \"Unable to get dependency information for \" + artifact.getId() + \": \"\n                                            + e.getMessage(),\n                                    artifact,\n                                    childRemoteRepositories,\n                                    e);\n                        }\n\n                        ArtifactResolutionRequest subRequest = new ArtifactResolutionRequest(metadataRequest);\n                        subRequest.setServers(request.getServers());\n                        subRequest.setMirrors(request.getMirrors());\n                        subRequest.setProxies(request.getProxies());\n                        recurse(\n                                result,\n                                child,\n                                resolvedArtifacts,\n                                managedVersions,\n                                subRequest,\n                                source,","sourceCodeStart":515,"sourceCodeEnd":551,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java#L515-L551","documentation":"While recursing into the dependency graph, DefaultLegacyArtifactCollector asks the ArtifactMetadataSource (retrieve/releaseDependencies) for a child artifact's metadata and POM; an ArtifactMetadataRetrievalException there is wrapped into ArtifactResolutionException('Unable to get dependency information for <artifactId>: <cause>'), with the dependency trail set from the parent node and the child's remote repositories attached. This is the legacy resolver failing to read transitive dependency metadata, not the artifact file itself.","triggerScenarios":"Transitive resolution where retrieval of a child artifact's metadata throws: unreachable repository, missing maven-metadata.xml/POM for the child version, authentication failure, or corrupt cached metadata in the local repository — surfaced through the legacy collector in a build or tool embedding maven-compat.","commonSituations":"Corporate proxy blocking a repo mid-build; snapshot dependencies whose metadata is inconsistent between mirrored nodes; a repository returning HTML error pages instead of POMs; CI caching a partially-downloaded local repository.","solutions":["Inspect the wrapped ArtifactMetadataRetrievalException cause and the artifact id in the message to identify which repository/transfer failed","Fix repository access: settings.xml <server> credentials, mirrorOf rules, proxy config, or remove -o offline mode","Purge suspect cached artifacts with mvn dependency:purge-local-repository -DreResolve=true (or delete the artifact's directory under ~/.m2/repository) then rebuild with -U","If the child artifact is optional for you, exclude it with <exclusions> to unblock the build while the upstream issue is fixed"],"exampleFix":"# before\nmvn install   # Unable to get dependency information for com.example:lib:jar:1.0\n\n# after: clear corrupt cache and force metadata refresh\nrm -rf ~/.m2/repository/com/example/lib\nmvn -U install","handlingStrategy":"try-catch","validationCode":"// Pre-check reachability of the repositories used for transitive resolution\nfor (ArtifactRepository remote : request.getRemoteRepositories()) {\n    if (!repoManager.isReachable(remote)) { // HEAD/GET on repo root or metadata URL\n        throw new IllegalStateException(\"Remote repository unreachable before resolve: \" + remote.getId());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    collector.collect(...);\n} catch (ArtifactResolutionException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Unable to get dependency information for\")) {\n        Artifact failed = e.getArtifact(); // the child whose metadata could not be read\n        // decide: retry after fixing access, or exclude the failing dependency\n        suggestExclusion(failed);\n    }\n}","preventionTips":["Keep the local repository pristine in CI: purge or use isolated -Dmaven.repo.local per job to avoid corrupt caches","Pin down mirror and credential configuration in settings.xml per environment and validate them at job start","Watch for repositories returning HTML error pages — configure a repository manager instead of direct internet access"],"tags":["maven","dependency-resolution","transitive-dependencies","metadata","remote-repository","legacy-compat"],"backgroundTag":"metadata-retrieval-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}