Visit help.sonatype.com for documentation on Nexus Repository version 3..
Problem
You receive 404 responses when trying to retrieve artifacts from a repository, but you know the artifact is present in Nexus Repository.
Possible causes
1. NFC ( Not found Cache )
Artifacts may be in the 'Not Found Cache' (NFC). Nexus Repository caches items that are not found in a repository for a period of time specified in the repository's configuration. This is done for performance reasons. Typical reasons for artifacts to be in NFC:
- The repository is a proxy, and an attempt was made to retrieve the artifact before it was available on the remote
- The user has manually restored artifacts into a remote proxy hosted repository
You can clear the cache by clicking 'Invalidate cache' on the repository's configuration page. Note that group repositories do not have an NFC cache, only proxy repositories contained in groups.
2. Nexus Repository Configuration Problems
- The hosted/proxy repository is not in the group repository.
- There is a content selector defined which prevents access to the component in the group repository.
3. Read Timeouts
The most likely cause is a firewall that has virus scanning turned on. Users can work around this by increasing the HTTP read timeouts in Nexus Repository (either globally or per proxy repository).
Note: Usually the end user is unaware that IT has changed the firewall, so it may not be obvious this could be the real problem.
4. Invalid Metadata
SNAPSHOT look-ups, or version ranges, or un-versioned dependencies (typically plugins) will trigger metadata look-up. If the version referenced by the maven-metadata.xml is not present, you will get a 404.
This can usually be fixed by running rebuild metadata on the affected artifact.
5. Maven POM Dependency Typos
This actually happens more often than you might think - there is a typo in the pom.xml dependency.
Make sure the GAV Maven is looking for matches what is in the repository.
One nice technique is to find the artifact in Nexus Repository UI and paste the XML from the Artifact information panel into the pom.xml. This provides a handy way to avoid this problem in the future.
6. Maven settings.xml or POM repository config blocks downloads
If you have a mirror or repository defined in your settings.xml or POM, make sure it is configured to allow both releases and snapshots. When Maven decides it should block using a repository to download a release or SNAPSHOT based on this criteria, it does not provide a message indicating this was why.
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
7. Diagnose with Nexus Repository using ?describe
You can add "?describe" to the end of an artifact's URL in the browser which will display a page that describes the processing of a request made by external client, using information from the request, retrieved item (or exception if not item was retrieved) and some intermittent processing states.
This can help diagnosing reasons why an artifact isn't found. For example, you may see below exception that indicates the artifact is missing from the blob store for some reason.