温馨提示:本文翻译自stackoverflow.com,查看原文请点击:migration - How to migrate Maven packages from Nexus to Azure Artifacts

migration - 如何将Maven程序包从Nexus迁移到Azure Artifacts

发布于 2020-03-29 13:14:28

我正在尝试将构建包从本地Nexus Repository Manager迁移到Azure Artifacts。我已经找到了这个Microsoft链接,链接解释了如何使用Powershell脚本为NuGet(.NET包管理器)执行此操作,但是Maven没有此类工具。

I was thinking about retrieving all the build files with a "maven clean compile" and then pointing my pom.xml file to Azure Artifacts and then somehow push them. However, the amount of packages run into the 100k and there are many applications using it. So this feels like a very clunky way of going about it that will take a lot of effort and a lot of room for error.

Does anyone have any advice for me?

查看更多

查看更多

提问者
Herman
被浏览
38
Herman 2020-01-31 17:38

It turns out my issue mainly caused by my limited understanding of Artifact repos and the dependency chain of the project. Apparently it Artifact repos do caching of all the upstream repos so that's why there where 100k files in there. In the end there were only two company specific dependencies that needed moving.

我按照以下方式完成了迁移(适用于所有Maven迁移):

克隆链中最高的依赖项。(可能包含具有共同点或父母的名字)

如以下所述,将Azure Artifacts配置添加到$ {USER_HOME} /。m2 / settings.xml和pom.xml:https ://robeco.visualstudio.com/Delivery%20Integration%20Services/_packaging?_a=connect&feed=Maven-feed

从当前仓库中获取依赖项

mvn install
mvn package

创建一个发布版本(其后没有-SNAPSHOT)并将其推送到Azure Artifacts(否则,由于未发布依赖项错误,您将获得无法发布项目)

mvn release:clean
mvn release:prepare
mvn release:perform

现在您有了类似robeco-common-version1.0.16的构建。现在将其部署到Azure Artifacts

mvn deploy

您应该看到类似上载到Maven提要的内容:https : //robeco.pkgs.visualstudio.com/ ...。

对所有后续公司特定的依赖项执行相同的步骤。

发布
问题

分享
好友

手机
浏览

扫码手机浏览