{"record":{"id":"73fe44b66ad44e39","repo":"apache/maven","slug":"failure-to-resolve-remotepath-from-rep","errorCode":null,"errorMessage":"Failure to resolve \" + remotePath + \" from \" + repository.getUrl() + \" was cached in the local repository. Resolution will not be reattempted until the update interval of \" + repository.getId() + \" has elapsed or updates are forced. Original error: \" + error","messagePattern":"Failure to resolve \" \\+ remotePath \\+ \" from \" \\+ repository\\.getUrl\\(\\) \\+ \" was cached in the local repository\\. Resolution will not be reattempted until the update interval of \" \\+ repository\\.getId\\(\\) \\+ \" has elapsed or updates are forced\\. Original error: \" \\+ error","errorType":"exception","errorClass":"TransferFailedException","httpStatus":null,"severity":"error","filePath":"compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java","lineNumber":142,"sourceCode":"                    updateCheckManager.touch(artifact, repository, null);\n                } catch (ResourceDoesNotExistException e) {\n                    updateCheckManager.touch(artifact, repository, null);\n                    throw e;\n                } catch (TransferFailedException e) {\n                    String error = (e.getMessage() != null)\n                            ? e.getMessage()\n                            : e.getClass().getSimpleName();\n                    updateCheckManager.touch(artifact, repository, error);\n                    throw e;\n                }\n\n                logger.debug(\"  Artifact \" + artifact.getId() + \" resolved to \" + artifact.getFile());\n\n                artifact.setResolved(true);\n            } else if (!artifact.getFile().exists()) {\n                String error = updateCheckManager.getError(artifact, repository);\n                if (error != null) {\n                    throw new TransferFailedException(\"Failure to resolve \" + remotePath + \" from \"\n                            + repository.getUrl()\n                            + \" was cached in the local repository. \"\n                            + \"Resolution will not be reattempted until the update interval of \"\n                            + repository.getId() + \" has elapsed or updates are forced. Original error: \" + error);\n\n                } else {\n                    throw new ResourceDoesNotExistException(\n                            \"Failure to resolve \" + remotePath + \" from \" + repository.getUrl()\n                                    + \" was cached in the local repository. \"\n                                    + \"Resolution will not be reattempted until the update interval of \"\n                                    + repository.getId() + \" has elapsed or updates are forced.\");\n                }\n            }\n        }\n    }\n\n    @Override\n    public void getArtifact(","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java#L124-L160","documentation":"Thrown by the legacy DefaultWagonManager when an artifact's file does not exist locally and the update check manager has a previously recorded error for that artifact+repository. The first failed download (TransferFailedException) is cached in the resolver status files (_remote.repositories / *.lastUpdated) under ~/.m2/repository; until the repository's update interval elapses or -U forces recheck, Maven refuses to retry and rethrows the cached failure with its original error message.","triggerScenarios":"getArtifact() with force=false, updateCheckManager.isUpdateRequired()==false, artifact file missing, and updateCheckManager.getError() returning the message saved from an earlier TransferFailedException (auth failure, connection failure, checksum failure) recorded by touch(artifact, repository, error).","commonSituations":"The classic 'was cached in the local repository, resolution will not be reattempted' CI failure: a transient network/auth blip poisons the cache, then every rebuild replays it until -U or interval elapses; fixed credentials not picked up because the failure is remembered; Nexus down once at snapshot poll time.","solutions":["Re-run with -U (--force-update-checks) to bypass the cached failure and retry immediately","Fix the original error named after 'Original error:' (credentials, URL, proxy) - otherwise -U just re-caches it","Delete the artifact's directory under ~/.m2/repository (and its *.lastUpdated files) to clear the poisoned state","Check repository <releases>/<snapshots> updatePolicy in the POM - 'never' or long 'interval:X' keeps the cache hot; 'always' avoids this trap","In pipelines, use isolated local repos or -U for jobs that must not inherit cache state"],"exampleFix":"# before\nmvn clean install\n# after\nmvn clean install -U\n# or purge the cached state\nrm -rf ~/.m2/repository/com/example/broken-artifact","handlingStrategy":"retry","validationCode":"// Detect a poisoned cache before building\nPath lastUpdated = localRepoDir.resolve(\"_remote.repositories\");\nboolean poisoned = Files.exists(lastUpdated)\n    && Files.readString(lastUpdated).contains(\"ERROR\");\nif (poisoned) purgeArtifactDir(localRepoDir); // or plan to run with -U","typeGuard":null,"tryCatchPattern":"catch (org.apache.maven.wagon.TransferFailedException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"was cached in the local repository\")) {\n        // rerun resolution with force=true / mvn -U after fixing the original error\n    }\n}","preventionTips":["Use -U in CI jobs that must not inherit cached failures","Fix root causes (credentials/proxy) before retrying, or -U just re-caches","Use per-build local repos in pipelines","Set sensible updatePolicy (interval:60 / always) on critical repos"],"tags":["maven","resolution","cache","update-check","legacy","network"],"backgroundTag":"cached-artifact-resolution-failure","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}