镜像关系
我们使用 maven/nexus 组合,效果很好。我们有一些自制项目/maven 插件上传到 nexus,每个人都可以按预期访问和使用它。我们的中央 Hudson 构建上传/管理 Nexus 工件。
我的公司添加了一个远程位置,但该位置的网络连接一直存在问题。一般来说,网络连接速度缓慢且不可靠。
如何在远程位置设置 Nexus,以便它反映我所在位置的 Nexus?这样,远程位置的开发人员可以指向本地 Nexus 服务器,该服务器可以镜像其他 Nexus 服务器。我们不喜欢将一个位置保留为主/控制位置 - 让生活更轻松。
这是正确的方法还是我们可以通过其他方式解决这个问题?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是正确的方法。
设置您的远程位置以镜像主 Nexus。 (以管理员身份登录,存储库,添加,代理存储库。
然后在开发人员的 Maven settings.xml 中添加远程位置的 Nexus 作为主 Nexus 的镜像。
首先访问工件被复制到远程位置。
就是这样。
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.
虽然这个问题有点老了,但无论如何,对于需要支持 ivy 和动态版本的存储库的问题可能会很有趣。在当前的 nexus 版本(~2.7)中,nexus pro 智能代理功能现在非常适合所有 Maven 用户,并且应该是解决您的问题的通用解决方案,但对于 ivy 自定义布局存在一个问题:
尽管如此,它不适用于特殊情况目前的布局。问题是,如果连接因某种原因断开,智能代理将无法工作。通常,使用动态版本(例如“1.2.+”)和代理上的自定义布局的请求应该导致从主服务器获取工件。这目前还不可能,但可能会在更高版本的 nexus (3.0) 中实现。
我们确保在临时连接中断的情况下完全代理我们的工件,方法是在主服务器上构建工件列表,然后在从服务器上构建列表,然后在代理上调用带有完整版本信息的简单 wget 脚本。它将陆续从主人那里取回丢失的神器。您可以将其称为一种“存储库复制”。
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".
我在没有任何互联网连接的 dmz-Intranet 中使用 Maven。在内网中,maven-central 不可用,但 Releasemanager 可以访问互联网并代理工件。
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.