Error Knowledge Base MAVEN FAILURE_TO_FIND_ARTIFACT

Failure to find artifact

Maven could not find an artifact in the configured repositories, and the missing result may be cached in the local repository.

Affected versions: All supported Apache Maven versions.

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

  1. Confirm the exact artifact coordinates Maven is trying to resolve (copy from the error output).
  2. Verify the artifact exists in the expected repository (Central or your internal repository manager) and that you're using the correct repository URL.
  3. If it is a snapshot, ensure a snapshot repository is configured and enabled for that build.
  4. Force updates once to bypass cached misses: mvn -U -DskipTests package.
  5. Delete the artifact's cached miss (*.lastUpdated) under ~/.m2/repository/<groupId path>/<artifactId>/, then rerun the build.
  6. 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 found result is preventing Maven from re-checking.

How to Verify

  1. Re-run mvn -DskipTests package and confirm Maven downloads the missing artifact.
  2. Confirm the artifact now exists in your local repo at ~/.m2/repository/<groupId path>/<artifactId>/<version>/.

Manual artifact availability checks

  1. Force a remote re-check once: mvn -U -DskipTests package.
  2. Fetch the artifact directly (replace coordinates): mvn -q -Dartifact=groupId:artifactId:version dependency:get.
  3. If the error mentions cached resolution, delete *.lastUpdated under ~/.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

  1. When Maven checks a repository and the artifact is not found, it records that result in the local repository using *.lastUpdated files.
  2. 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 -U in 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;

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list