Take the 2-minute tour ×

Our shop uses Nexus to proxy for Maven Central and several other repositories. From time to time we use it to search for artifacts to see if what other versions might be available. However it rarely, if ever, shows these newer versions of things. This has thrown off developers many times who expected to see them in Nexus if they existed at all.

A recent example is the 1.5.0.RELEASE version of org.springframework.flex:spring-flex. If wasn't in our Nexus index anywhere, but we could find it by Googling Maven Central. The Maven versions plugin was also able to find it.

How can we configure our Nexus to refresh its indices so we can trust it in the future?

share|improve this question
Good question. I had a quick look around and sonatype.com/books/nexus-book/reference/… seems to indicate it has to do with the "download remote indexes" setting. However, tweaking failed to get me the desired behavior. –  Jeen Broekstra Oct 13 '11 at 19:10
Yes - all my repo mirrors have the "download remote indexes" setting to true. But I have the feeling it only gets downloaded when you set the repository up. –  HDave Oct 19 '11 at 19:56
add comment

3 Answers

up vote 3 down vote accepted

I can see org.springframework.flex:spring-flex:1.5.0.RELEASE when I search for it, and I have a pretty plain-vanilla Nexus installation. Check in the repository's configuration for "Metadata Max Age". First log in, then click "Repositories" in the left panel, select the repo you're interested in ("Maven Central", right?), and click the "Configuration" tab at the bottom. "Metadata Max Age" is under the "Expiration Settings" section. If this is set to "-1", that means repo metadata will never be updated. Mine is set to 1440 minutes (24 hours), and I've never had a problem with failing to find new artifacts. The problem you're describing is exactly what this setting is supposed to prevent.

If that seems to not be working, you could try setting a scheduled task to update your indexes. Logged in as an administrator, select "Administration" in the left panel, and go to "Scheduled Tasks". Add a task with "Task Type" = "Download Indexes", and select the repository or repo group you want it to apply to (or "All Repositories"). Make sure you set a "Recurrence" on it. Do this for each repository/group that needs to be updated.

share|improve this answer
I am on Nexus 1.5 and don't have this option, though I suppose I could schedule a task. Will schedule the task now and upgrade to 1.9 later today or tomorrow and report back. –  HDave Oct 20 '11 at 17:21
Scheduling the re-download of the indexes for all repos has made the difference. I just re-ran "mvn versions:display-dependency-updates" and did a diff and now I see even newer versions of everything. Thanks! –  HDave Oct 20 '11 at 19:09
add comment

Nexus supports scheduled tasks to do all sorts of maintenance and it is good practice to include the index download in it. Check the book out in general it has lots of good information.

share|improve this answer
add comment

Have you tried to set up a scheduled task to download the remote indexes?

share|improve this answer
add comment

Your Answer


