-->

Auto mirroring Nexus Proxy Repository

2020-08-26 03:27发布

问题:

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 ?

回答1:

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:

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.



标签: nexus