且构网

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

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

更新时间:2023-02-25 20:45:25

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具有
  • 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