11

Currently, we have a nexus hosted-repository remotely (in a different geographic location). We have a local-proxy-repository locally to the hosted-repository.

Whenever there are new versions of a few files added to remote-hosted-repository, the first request for the newly added file from the build system is downloading it to local-proxy-repository.

The problem I have now is that some of the files being added are really huge (say around 400 MB). Therefore the first build consumes lot of time to finish.

Is there a way we can poll on remote-hosted-repository and auto-mirror it ?

2
  • To the upvoter - What I have ended up doing is running a jenkins job which sends the download request for any new dependency away before I start my work :)
    – Chris
    Apr 30, 2013 at 11:45
  • You could also setup two hosted repositories and sync between them (github.com/030/n3dr)
    – 030
    Dec 3, 2021 at 13:20

2 Answers 2

6

Nexus Professional 2.+ supports this as experimental feature of the Smart Proxy feature set. It is an experimental feature that is off by default, but should work just fine. Give it a go!

To turn it on go to "administration/capabilities". Check "show advanced" and then select the "smart proxy: subscribe" and enable preemptive fetch.

Update: as of Nexus 2.3 this is no longer deemed experimental and you can configure if for each repository that you proxy off.

2
  • Thanks for the reply. I'm using 2.0.4-1 Nexus but could not find the option you specified. But Here is what I did: Added a Scheduled task of "Synchronize Shadow Repository" and scheduled it daily. Would this achieve what I what ?
    – Chris
    Jul 25, 2012 at 11:09
  • 1
    Like I said... SmartProxy is a Nexus Professional feature. If you are using open source it won't be there. And the Synchronize Shadow Repository is for synchronizing between a virtual and an actual repository on the same repo server .. so that is something completely different. Jul 25, 2012 at 19:45
0

I cannot comment on Manfred's answer, so here is a new variant:

If you are running Nexus Professional, you can use Smart Proxy to synchronize repositories.

You need to go through the general setup as described on http://www.sonatype.com/books/nexus-book/reference/smartproxy.html first (establish trust, set up publishing hosted repo, set up receiving proxy repo). Only then is the capability created and Manfreds answer applies:

Go to "Administration/Capabilities", check "Show Advanced" and select the "Subscribe" capability for your proxy repo. There you can turn on preemptive fetching, which will automatically download new artifacts in your hosted repository on the proxy.

1
  • with some added detail about setting up publish/receive on the repositories. Without that, the capability is not created.
    – nabcos
    Jul 26, 2012 at 19:56

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.