且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将工件从存储库移动到另一个存储库?

更新时间:2023-02-25 20:49:09

Maven 存储库管理器 Nexus、Artfactory、Archiva 并非旨在镜像远程存储库的内容.它们会缓存用户检索到的所有文件,从而提高构建效率并使您免受网络中断的影响.

Maven repository managers Nexus, Artfactory, Archiva are not designed to mirror the content of remote repositories. They cache any files retrieved by users, and this improves build efficiency and insulates you against network outages.

像任何缓存一样,挑战是保持最新.Maven 存储库管理器所做的就是下载远程内容的增量索引,使用户能够搜索文件和查看新版本,而无需下载所有内容.(2011 年 Maven Central 估计为 350GB,来源)

Like any cache the challenge is keeping up to date. What all the Maven repository managers do is download an incremental index of the remote content, enabling users to search for files and see new releases, without downloading everything. (In 2011 Maven Central was estimated at 350GB, source)

总而言之,只需设置您的 Maven 存储库,将您的构建指向它,来自 Maven Central 的工件就会自动下载.

So in conclusion, just setup you Maven repository, point your build at it and the artifacts from Maven Central will be downloaded automatically.

补充说明:

  • 您的存储库管理器的功能值得一看.它们可能具有额外的非标准功能.例如 Nexus Professional 有一个 智能代理功能 用于保持托管存储库同步,尽管我不知道这是否适用于 Maven Central
  • It's worth looking at the capabilities of your repository manager. They may have additional non-standard features. For example Nexus Professional has a smart proxy feature for keeping hosted repositories synced, although I don't know if this will work with Maven Central