{"record":{"id":"95a2e4d3128382ff","repo":"apache/maven","slug":"unable-to-download-the-artifact-from-any-repositor","errorCode":null,"errorMessage":"Unable to download the artifact from any repository","messagePattern":"Unable to download the artifact from any repository","errorType":"exception","errorClass":"ResourceDoesNotExistException","httpStatus":null,"severity":"error","filePath":"compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java","lineNumber":204,"sourceCode":"                tfe = e;\n\n                String msg = \"Unable to get artifact \" + artifact.getId() + \" from repository \" + repository.getId()\n                        + \" (\" + repository.getUrl() + \"): \" + e.getMessage();\n\n                if (logger.isDebugEnabled()) {\n                    logger.warn(msg, e);\n                } else {\n                    logger.warn(msg);\n                }\n            }\n        }\n\n        // if it already exists locally we were just trying to force it - ignore the update\n        if (!artifact.getFile().exists()) {\n            if (tfe != null) {\n                throw tfe;\n            } else {\n                throw new ResourceDoesNotExistException(\"Unable to download the artifact from any repository\");\n            }\n        }\n    }\n\n    @Override\n    public void getArtifactMetadata(\n            ArtifactMetadata metadata, ArtifactRepository repository, File destination, String checksumPolicy)\n            throws TransferFailedException, ResourceDoesNotExistException {\n        String remotePath = repository.pathOfRemoteRepositoryMetadata(metadata);\n\n        getRemoteFile(repository, destination, remotePath, null, checksumPolicy, true);\n    }\n\n    @Override\n    public void getArtifactMetadataFromDeploymentRepository(\n            ArtifactMetadata metadata, ArtifactRepository repository, File destination, String checksumPolicy)\n            throws TransferFailedException, ResourceDoesNotExistException {\n        String remotePath = repository.pathOfRemoteRepositoryMetadata(metadata);","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java#L186-L222","documentation":"Final verdict of the legacy multi-repository getArtifact(): Maven iterated every configured remote repository, ResourceDoesNotExistException from each was swallowed (logged at debug), no TransferFailedException was recorded, and the file still does not exist locally - so it throws ResourceDoesNotExistException 'Unable to download the artifact from any repository'. In contrast to the cached variants, each repository was actually checked and answered 'not found'.","triggerScenarios":"getArtifact(artifact, remoteRepositories, monitor, force) where every repository either has the repo disabled for the artifact policy, misses the artifact path (404), or is skipped, and the local file is absent; no hard transfer error occurred anywhere.","commonSituations":"Wrong groupId/artifactId/version (typo, uncommitted version bump); artifact deployed to a private repo not in the build's repository list; releases policy disabled where a release is sought (or vice versa); mirrors absorbing all traffic without hosting the artifact; dependencies on a coworker's local-only artifact.","solutions":["Verify the exact coordinates (groupId:artifactId:version:packaging:classifier) against the repository (search Nexus/Central web UI)","Add the repository that actually hosts the artifact to the POM or settings.xml, and exempt it from mirrorOf 'catch-alls'","Check the repository policy: a snapshots-only repo cannot serve releases and vice versa","Confirm the artifact was actually deployed (CI deploy job succeeded) and re-check version spelling including -SNAPSHOT suffixes","Run with -e -X to see every repository URL that was tried and each 404 path"],"exampleFix":"# before: repo hosting artifact not declared\n<dependency><groupId>com.corp</groupId><artifactId>lib</artifactId><version>1.2</version></dependency>\n# after: declare (or mirror-exempt) the hosting repo\n<repositories>\n  <repository>\n    <id>corp-releases</id><url>https://nexus.corp.example/releases</url>\n  </repository>\n</repositories>\n# plus settings.xml mirror: <mirrorOf>*,!corp-releases</mirrorOf>","handlingStrategy":"try-catch","validationCode":"// Before resolving, confirm each coordinate exists in at least one configured repo\n// for (repo : repos) { if (exists(repo.url + '/' + groupPath + '/' + artifactId + '/' + version)) ok; }","typeGuard":null,"tryCatchPattern":"catch (org.apache.maven.wagon.ResourceDoesNotExistException e) {\n    if (\"Unable to download the artifact from any repository\".equals(e.getMessage())) {\n        // every repo said 404: verify coordinates/repos/policies; run -X to list tried URLs\n    }\n}","preventionTips":["Double-check groupId/artifactId/version/classifier before adding dependencies","Declare the hosting repository and exempt it from catch-all mirrors","Verify releases/snapshots policy of each repo matches the dependency type","Run with -X once to see the exact URLs Maven tried"],"tags":["maven","resolution","not-found","repository","dependency"],"backgroundTag":"artifact-not-found-in-repositories","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}