When maven-metadata.xml files are downloaded through a group repository Nexus will periodically need to check all the repositories in the group for the requested file. The reason for this is the same GA or GAV may exist in multiple repositories, and all of the maven-metadata.xml files must be merged from all potential locations to get the complete group level file.
How often Nexus does these checks is controlled by a few factors.
- For hosted repositories it will always check since this is a very cheap operation
- For proxy repositories this is controlled by two settings, "metadata max age" and "not found cache ttl". The former controls how long to wait before checking for updates to files which have already been downloaded, the latter how long to wait to check and see if a file that wasn't there previously is now present. The default for both of these is 24 hours.
So the most likely cause of slow downloads for maven-metadata.xml files is that one of your proxy repositories has a very slow remote. This problem will be compounded if either of the above two settings is set too low.
You can optimize the way Nexus searches through group repositories by adding routing rules. Information about this can be found here:
Tip: On Nexus 2.7.x and later go to "administration/logging" and add a DEBUG level logger for "remote.storage.outbound". This will allow you to see the processing times of all outbound requests. With this information you can see which proxy repository is causing the problem.
Nexus Repo 3.x: For Nexus Repository Manager 3.x the equivalent logger is "org.sonatype.nexus.httpclient.outbound".