What This Error Means
Maven could not find an artifact in the configured repositories, and the missing result may be cached in the local repository.
How to Fix It
- Confirm the exact artifact coordinates Maven is trying to resolve (copy from the error output).
- Verify the artifact exists in the expected repository (Central or your internal repository manager) and that you're using the correct repository URL.
- If it is a snapshot, ensure a snapshot repository is configured and enabled for that build.
- Force updates once to bypass cached misses:
mvn -U -DskipTests package. - Delete the artifact's cached miss (
*.lastUpdated) under~/.m2/repository/<groupId path>/<artifactId>/, then rerun the build. - If you are behind a mirror/proxy repository, confirm it is proxying the correct upstreams and that the artifact isn't blocked by policy.
Why It Happens
- The dependency coordinates are wrong (typo in groupId/artifactId/version).
- You are trying to resolve a snapshot from a release-only repository (or vice versa).
- The artifact is hosted in a private or non-default repository that is not configured for this build.
- The artifact was recently published, but a cached
not foundresult is preventing Maven from re-checking.
How to Verify
- Re-run
mvn -DskipTests packageand confirm Maven downloads the missing artifact. - Confirm the artifact now exists in your local repo at
~/.m2/repository/<groupId path>/<artifactId>/<version>/.
Manual artifact availability checks
- Force a remote re-check once:
mvn -U -DskipTests package. - Fetch the artifact directly (replace coordinates):
mvn -q -Dartifact=groupId:artifactId:version dependency:get. - If the error mentions cached resolution, delete
*.lastUpdatedunder~/.m2/repository/<groupId path>/<artifactId>/and retry.
Common CLI Output
[ERROR] Failure to find com.example:missing:jar:1.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced[ERROR] Could not find artifact com.example:missing:jar:1.0.0 in central (https://repo.maven.apache.org/maven2) Why Maven caches missing artifacts
- When Maven checks a repository and the artifact is not found, it records that result in the local repository using
*.lastUpdatedfiles. - Until the repository update interval elapses (or updates are forced), Maven may skip re-checking remote repositories for that artifact.
Prevention Tips
- Use a repository manager as the single source for upstream artifacts so all environments resolve consistently.
- Avoid consuming unpublished snapshots across machines, publish snapshots/releases before depending on them.
- When publishing a new version, expect some caching, use
-Uin CI if you depend on freshly published snapshots.
Where This Can Be Triggered
github.com/apache/maven/blob/maven-3.9.6/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
Resolver "not found" failures (including cached misses like "Failure to find ... was cached ...") bubble up into Maven via the underlying exception message (e.getMessage()). - GitHub
String msg = "Could not resolve dependencies for project " + project.getId() + ": " + e.getMessage();
DependencyResolutionException dex = new DependencyResolutionException(msg, e);
dex.setResult(e.getResult());
throw dex;