Maven
Artifact Descriptor
Troubleshooting
Build Tools
Maven Errors

Maven "Failed to read artifact descriptor for" error: causes and fixes

Codemia Knowledge Hub ·

"Failed to read artifact descriptor" means Maven could not download or parse the POM file of a dependency. The cause is usually a corrupted local cache, wrong dependency coordinates, a network or proxy problem, or a misconfigured repository. Most of the time, deleting the failing artifact from the local repository and re-running the build fixes it.

What the artifact descriptor is

To resolve a dependency, Maven first downloads the artifact's POM file (its descriptor) from a remote repository and uses it to resolve transitive dependencies. The error fires when Maven cannot fetch that POM or cannot parse it.

A typical stack trace:

 
1[ERROR] Failed to execute goal on project my-app:
2  Could not resolve dependencies for project com.example:my-app:jar:1.0:
3  Failed to read artifact descriptor for
4  org.apache.commons:commons-lang3:jar:3.12.0:
5  Could not transfer artifact org.apache.commons:commons-lang3:pom:3.12.0
6  from/to central (https://repo.maven.apache.org/maven2):
7  Connection timed out

The last line is the real cause. Here it is a network timeout, but it varies.

Causes and fixes

1. Corrupted local repository cache

Maven caches downloads under ~/.m2/repository. If a download was interrupted, the cached POM may be truncated or contain an HTTP error page instead of XML, and Maven keeps reading the bad file instead of re-downloading.

bash
1# Delete the specific artifact's local cache
2rm -rf ~/.m2/repository/org/apache/commons/commons-lang3/3.12.0
3
4# Re-run the build
5mvn clean install

For a broader cleanup:

bash
# Purge all locally cached metadata and re-resolve
mvn dependency:purge-local-repository

2. Wrong dependency coordinates

A typo in groupId, artifactId or version sends Maven looking for an artifact that does not exist, and Maven reports "not found" as "failed to read."

xml
1<!-- Wrong: typo in groupId -->
2<dependency>
3    <groupId>org.apache.common</groupId>  <!-- should be "commons" -->
4    <artifactId>commons-lang3</artifactId>
5    <version>3.12.0</version>
6</dependency>
7
8<!-- Correct -->
9<dependency>
10    <groupId>org.apache.commons</groupId>
11    <artifactId>commons-lang3</artifactId>
12    <version>3.12.0</version>
13</dependency>

Check coordinates on Maven Central before assuming a network problem.

3. Network or proxy problems

If your machine cannot reach the remote repository, Maven cannot download the descriptor. Expect connection timeouts or SSL handshake failures.

bash
1# Test connectivity to Maven Central
2curl -I https://repo.maven.apache.org/maven2/
3
4# If behind a proxy, configure it in ~/.m2/settings.xml
xml
1<!-- ~/.m2/settings.xml proxy configuration -->
2<settings>
3  <proxies>
4    <proxy>
5      <id>company-proxy</id>
6      <active>true</active>
7      <protocol>https</protocol>
8      <host>proxy.example.com</host>
9      <port>8080</port>
10      <username>proxyuser</username>
11      <password>proxypass</password>
12    </proxy>
13  </proxies>
14</settings>

4. Missing or misconfigured repository

An artifact hosted in a private or third-party repository (not Maven Central) needs that repository declared in the POM or settings.xml.

xml
1<!-- pom.xml: declare a custom repository -->
2<repositories>
3    <repository>
4        <id>jitpack</id>
5        <url>https://jitpack.io</url>
6    </repository>
7</repositories>
xml
1<!-- settings.xml: mirror configuration for corporate Nexus/Artifactory -->
2<settings>
3  <mirrors>
4    <mirror>
5      <id>nexus</id>
6      <mirrorOf>*</mirrorOf>
7      <url>https://nexus.internal.example.com/repository/maven-public/</url>
8    </mirror>
9  </mirrors>
10</settings>

mirrorOf set to * routes every repository request through the mirror. If the mirror is down or misconfigured, every artifact resolution fails.

5. Stale marker files in the local cache

Maven writes .lastUpdated and _remote.repositories marker files into the local cache. These can tell Maven "this artifact does not exist on any repository" and stop it from retrying even after you fix the real issue.

bash
1# Find and remove marker files for a specific artifact
2find ~/.m2/repository/org/apache/commons/commons-lang3 \
3  -name "*.lastUpdated" -delete
4
5find ~/.m2/repository/org/apache/commons/commons-lang3 \
6  -name "_remote.repositories" -delete

Re-run the build and Maven attempts a fresh download.

Diagnostic commands

Before trying fixes at random, see what Maven is actually doing:

bash
1# Debug mode: shows every repository Maven contacts and every file it tries to read
2mvn clean install -X 2>&1 | grep -i "artifact\|download\|failed"
3
4# Dependency tree: shows where the failing artifact is required
5mvn dependency:tree
6
7# Effective POM: shows the fully resolved POM including inherited repositories
8mvn help:effective-pom
9
10# Effective settings: shows the resolved settings.xml (useful for proxy/mirror issues)
11mvn help:effective-settings

Symptom to fix table

SymptomMost Likely CauseFix
"Connection timed out" in the errorNetwork or proxy issueCheck connectivity; configure proxy
Error persists after network is confirmedCorrupted local cacheDelete the artifact folder under ~/.m2/repository
Artifact not found on Maven CentralWrong coordinates or private repoVerify groupId/artifactId/version; add repository declaration
Error appeared after changing settings.xmlMirror or repository misconfigurationCheck mirrorOf and repository URLs
Build worked yesterday, fails today.lastUpdated marker blocking retryDelete marker files for the artifact
Error only in CI, not locallyDifferent settings.xml or network rulesCompare CI and local settings.xml; check CI proxy

Mistakes that keep the error around

  • Running mvn dependency:purge-local-repository without -DactTransitively=false. By default it also purges transitive dependencies, which is slow and usually unnecessary.
  • Ignoring the bottom of the stack trace. "Failed to read artifact descriptor" is the symptom; the cause (timeout, 404, SSL error, parse error) is always further down.
  • Adding random repositories to the POM hoping one has the artifact. Each one slows builds and can introduce security risks.
  • Forgetting that Maven caches "not found" results. After fixing the real issue (adding a repository, correcting coordinates), you still need to delete the .lastUpdated files or the cached entry.
  • Expecting -U (force update snapshots) to re-download corrupted release artifacts. It only affects SNAPSHOT metadata.

Course
Intermediate
27 lessons
14 hours
OOD Fundamentals

Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.

View the course
Data Structures & Algorithms practice on Codemia

Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.

Practice algorithms