在本地网络中使用Sonatype nexus [英] Using Sonatype nexus in local network

查看:126
本文介绍了在本地网络中使用Sonatype nexus的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功为Java应用程序创建了一个小型软件工程环境(SEE),其中包括基于maven和nexus的其他工具。我的实际问题是 - 并不是一个真正的惊喜 - nexus通常需要访问互联网才能从中央存储库获取所请求的工件。但SEE必须严格离线,并且无法改变它(安全原因)。

I've successfully created a small software engineering environment (SEE) for Java applications that is - amongst other tools - based on maven and nexus. My actual problem is - not a real surprise - that nexus usually requires access to the internet to to get the requested artifacts from the central repositories. But the SEE has to be strictly off-line and there's no way to change it (.. security reasons).

我的第一个快速解决方案是镜像nexus / maven安装在机器上,连接到互联网,运行一些标准的pom来填充镜像连接,并通过CD-ROM将缓存迁移到目标系统。蛮丑的。我真的不希望调整该过程来获取工件或新工件的更新。事实上,我们现在通常只是导入我们需要的库并创建新工件(使用nexus),而不是使用来自中央和其他人的官方工具。

My first quick solution was to mirror the nexus/maven installation on machine, that was connected to the internet, run some standard pom's to populate the mirrored nexus and migrate the cache via CD-ROM to the target system. Pretty ugly. I'm not really looking forward to adapt that process to get updates for artifacts or new ones. In fact, we now usually just import the libraries we need and create new artifacts (with nexus) instead using the official ones from central and others.

有没有人面对同样的挑战并找到一种更聪明有效的方法?

Has anybody faced the same challenge and found a more clever and efficient approach?

编辑

谢谢你所有的答案,我想我必须更准确地解决实际问题和我正在考虑的解决方案:我认为我必须创建,填充和同步一个私有的中央存储库,基于中央和其他回收在互联网上,或者确切地说:两个相同的存储库。一个连接到互联网,另一个连接到本地网络。然后我可以保持互联网连接的存储库最新并通过DVD将更改复制到本地存储库 - 这对于Nexus是可见的。

Thanks for all the answers, I think I have to be more precise on the actual problem and the solution I'm thinking of at the moment: I think I have to create, populate and synchronize a private 'central' repository, based on central and other repos on the internet, or exactly: two identical repositories. One connected to the internet the other on the local network. Then I can keep the internet connected repository 'up-to-date' and copy the changes via DVD to the local repository - which is visible for Nexus.

它是否有效?是否有关于如何在私人服务器上设置中心之类的文档,是否有一种同步所选工件的机制?

Would it work? Is there documentation available on how to setup something like 'central' on a private server, is there a mechanism to synchronize selected artifacts?

(不想发布我的一开始的想法,因为我希望得到完全不同的想法)

(didn't want to post my thoughts at the beginning because I hoped to get totally different ideas)

编辑2 - 最佳实践 - 根据要求添加

我们在完全脱离互联网的环境中使用maven的最佳做法:

Our "best practice" for using maven in an environment which is totally disconnected from the internet:


  • 我们在中央服务器上安装了nexus,因此软件开发工作站有一台服务器可以与之交谈(这是我们自己的人工制品库)。

  • 我们将POM文件导出到工作站通过Internet访问,清除了该计算机上的本地存储库并执行了依赖:go-offline 插件)。这填充了本地存储库中所有必需的人工制品

  • 我们将此本地存储库导入安全环境并将所有插件添加到nexus(只复制文件 - 结构相同)

  • We installed nexus on a central server, so that the software development workstations had a server to talk to (and it was our own artefact repository)
  • We exported the POM files to a workstation with internet access, cleared the local repository on that machine and did a dependency:go-offline (plugin). This populated the local repository with all required artedfacts
  • We imported this local repository to the secure environment and added all plugins to nexus (just copied the files - the structure is identical)

每周一次使用所有POM文件(可以自动化)并且你有一个相当稳定和可用的本地存储库。

Do this once a week with all POM files (can be automated) and you have a quite stable and usable local repository.

推荐答案


它会起作用吗?是否有关于如何在私有服务器上设置中心之类的文档,是否存在同步所选工件的机制?

Would it work? Is there documentation available on how to setup something like 'central' on a private server, is there a mechanism to synchronize selected artifacts?

好吧,你可以成为中心的镜像但是,获取~10 GB文物的重点是什么?您不需要所有这些,通常的建议是使用存储库管理器。

Well, you could become a mirror of central but, what's the point of grabbing ~10 GB of artifacts? You won't need all of them and the usual recommendation is to use a repository manager.

其实我的初步想法是:


  1. 使用连接到互联网的Nexus在SEE之外

  2. rsync 此Nexus的内容为DVD。

  3. 通过DVD将内容复制到SEE的Nexus。

  4. 定期重复。<​​/ li>
  1. Use a Nexus connected to the internet outside the SEE
  2. rsync the content of this Nexus to a DVD.
  3. Copy the content to the Nexus of the SEE via a DVD.
  4. Repeat periodically.

我发现这个解决方案很难看,但现在我们有了更多细节根据您的情况,这可能是可以接受的。

I found this solution ugly but, now that we have more details on your situation, it might be an acceptable.

这篇关于在本地网络中使用Sonatype nexus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆