Reputation: 1500
We use maven/nexus combo and it works nicely. We have some home made projects/maven plugin uploaded to nexus and everyone is able to access and use it as expected. Our central hudson build uploads/manages nexus artifacts.
My company has added a remote location and network connectivity has been a problem to that location. In general network connectivity is slow and unreliable.
How do I set up nexus at remote location so that it mirrors nexus at my location? That way developers at remote location can point to local nexus server which can mirror other nexus server. We prefer t keep one location as master/controlling location - makes life easier.
Is this right way to do it or we can solve this problem in some other way?
Upvotes: 4
Views: 7178
Reputation: 1976
I use maven in a dmz-intranet without any internet connection. In the intranet maven-central is not available but releasemanager can access the internet and proxy the artifacts.
Upvotes: 0
Reputation: 7716
The issue is little bit old though, maybe of interest anyway for issues concerning repositories that need to support ivy and dynamic versions. With current nexus versions (~2.7) the nexus pro smart proxy feature works perfectly for all maven users now and should be the general solution for your very issue, but for ivy customized layouts there's an issue:
Nonetheless, it won't work for special layouts at the moment. The problem is, that smart proxy wouldn't work if the connection is somehow down. Normally a request using dynamic versions (e.g. "1.2.+") and customized layout at the proxy should result in a fetch of the artifact from the master. This is not possible yet, but may be in later versions of nexus (3.0).
We ensured to have proxied our artifacts completely, also during the case of a temporary connection breakdown, by building lists of the artifacts at the master, then building a list at the slave then calling a simple wget script with the complete version information at the proxy. It will successively fetch the missing artifact from the master. You may call it a type of "repository replication".
Upvotes: 1
Reputation: 11607
That is the right way.
Set up your remote location to mirror the main Nexus. (Login as admin, Repositories, Add, Proxy Repository.
Then in the developers' Maven settings.xml add the remote location's Nexus as mirror for your main Nexus.
At first access artifacts are copied to the remote location.
That's it.
Upvotes: 3