A Client Asked:
We want to proxy a SNAPSHOT repository from one nexus instance to another (also another location). We have setup the proxy repo with the following Expiration Settings:
|Not Found Cache TTL||0||minutes|
|Artifact Max Age||0||minutes|
|Metadata Max Age||0||minutes|
|Item Max Age||0||minutes|
What we want to achieve is the following: If a user deploys to the SNAPSHOT repository in location A and another user requests for the latest SNAPSHOT in location B, Nexus from location B should copy the latest version from A and deliver it to B. Or is there is another approach for such situations?
Sonatype Support Answered
Metadata max age is the one that matters for snapshots, as long as Maven gets the latest maven-metadata.xml files it will be able to retrieve the latest timestamped snapshots.
You might also need to set the not found cache ttl to 0 though, this will be occasionally needed in cases where the first snapshot for a GAV is published. If a build running against the proxy attempts to retrieve this before it is available on the master, the 404 response will be cached for the period of time set in the not found cache ttl.
If Nexus Pro is an option then take a look at the smart proxy feature, it’s designed to handle this situation and still allow proper caching to take place.
Rich Seddon, Manager QE/Support at Sonatype
Latest posts by Rich Seddon (see all)
- Nexus 3 Registry for Docker – Authentication - October 30, 2015
- Nexus 2.11.4 Released - July 17, 2015
- Improving NuGet and Nexus Performance – Recommendation - May 13, 2015
- Q&A: Best Practices for Disk Upgrade on Nexus Server - November 5, 2014
- Q&A: How to Retrieve the Latest Timestamped Snapshots - October 29, 2014