Skip to content
Latchkey

Maven "Failed to read artifact descriptor" - Fix in CI

To resolve a dependency, Maven first reads its POM (the "artifact descriptor"). This error means it could not fetch or parse that POM - the descriptor is missing, corrupt in ~/.m2, or its own parent/repo is unreachable.

What this error means

Resolution fails early with Failed to read artifact descriptor for <groupId>:<artifactId>:<packaging>:<version>, often followed by a Could not transfer or Could not find cause for the dependency’s POM.

mvn output
[ERROR] Failed to execute goal on project app: Could not resolve dependencies
for project com.example:app:jar:1.0.0:
Failed to read artifact descriptor for com.example:lib:jar:2.3.1:
Could not transfer artifact com.example:lib:pom:2.3.1 from/to central: Connection reset

Common causes

Corrupt or truncated POM in the local repo

An interrupted download can leave a half-written .pom in ~/.m2. Maven then cannot parse the descriptor and fails before downloading the jar.

Dependency POM or its parent is unreachable

The descriptor references a parent POM or a repository Maven cannot reach. The jar might exist, but without a readable POM resolution stops.

How to fix it

Purge the bad descriptor and re-resolve

Remove the offending path from the local repo and force a fresh fetch of the POM.

Terminal
rm -rf ~/.m2/repository/com/example/lib/2.3.1
mvn -U -B dependency:resolve

Ensure the descriptor’s repo and parent resolve

  1. Run mvn -X dependency:resolve to see exactly which POM (and which repo) failed.
  2. If the descriptor’s parent lives on a private repo, declare that repository.
  3. For a transient transfer error, enable wagon retries so a single blip does not fail the read.

How to prevent it

  • Avoid persisting ~/.m2 from interrupted/OOM-killed runs that can truncate POMs.
  • Declare every repository a dependency descriptor needs, including for its parent.
  • Set -Dmaven.wagon.http.retryHandler.count so a transient POM transfer retries.

Frequently asked questions

What causes ""Failed to read artifact descriptor""?
An interrupted download can leave a half-written .pom in ~/.m2. Maven then cannot parse the descriptor and fails before downloading the jar.
How do I fix "Failed to read artifact descriptor"?
Remove the offending path from the local repo and force a fresh fetch of the POM.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card