Visit my.sonatype.com for documentation on Nexus Repository version 2.
The Nexus Repository 2 Automatic Routing feature attempts to discover what is available on proxy repository remotes by obtaining the set of path prefixes available. When this information can be obtained Nexus Repository 2 will use it to optimize requests to the group repository, only querying repositories that it knows might contain the requested path. It is important to understand that this feature is just an optimization, Nexus Repository 2 will function just fine in situations where remote routing rules cannot be detected.
There are two strategies used to detect what is available on a remote. First, if the remote is a Nexus Repository 2 instance it may publish a file under ".meta/prefixes.txt" which contains this information. This file has the format as follows:
## repository-prefixes/2.0 # # Prefix file generated by Sonatype Nexus # Do not edit, changes will be overwritten! /archetype-catalog.xml /org/foo /com/bar /com/fubar
The remote will update this file whenever changes in it's stored artifacts require it. Currently, this file is published with two levels of directory information. On the proxy side, Nexus Repository 2 will periodically look for updates to this file according to the schedule specified in the proxy repository's "Routing" tab.
The other strategy used is that Nexus Repository 2 will scrape a published HTML directory listing to two levels deep if it is in a format that Nexus Repository 2 knows is reliable, such as an Apache web server.
A remote Nexus Repository 2 will only publish the prefixes.txt file for a repository when it can be 100% sure that it has complete information about what is contained in it. If there is doubt then the prefixes.txt file will not be published. Similarly, Nexus Repository 2 will only scrape an HTML directory listing if it is sure it is accurate.
If the remote is itself a proxy repository Nexus Repository 2 will only publish the prefixes.txt file if that proxy's remote has complete information. And group repositories will only publish prefix information if all of their contained repositories do so.