Azure Artifacts Feed比Maven Central慢得多 [英] Azure Artifacts Feed is much slower than maven central

查看:75
本文介绍了Azure Artifacts Feed比Maven Central慢得多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure DevOps开发一个项目,并且按照文档中的建议,我创建了一个带有maven Central作为上游源的工件提要,以存储我的所有依赖项(我现在真的不需要发布工件)

I'm working on a project in Azure DevOps and, as recommended in the doc, I created an Artifacts Feed with maven central as upstream source to store all my dependencies (I don't really need to publish artifacts for now).

因此,我将本地Maven配置为从Feed中获取所有依赖关系,而不是从Maven Central获取数据,并且一切正常,但与Maven Central相比非常慢.

So I configured my local maven to fetch all the dependencies from my feed instead of maven central and it all works fine, except that it's very slow compared to maven central.

当我从本地计算机上的空.m2开始时,从maven Central下载依赖项需要1分15秒来构建我的项目,但是从Maven Central下载依赖项需要8分钟以上的时间.Feed(已经包含所有依赖项).

When I start from an empty .m2 on my local machine, it takes 1 min 15 secs to build my project when downloading the dependencies from maven central, but it takes over 8 minutes to do the same when downloading the dependencies from the Feed (which contains already all the dependencies).

我可以忍受,因为所有内容的下载仅在首次构建时发生.

I could live with that, since the download of everything happens only on the first build.

但是问题是从Azure Pipelines构建我的项目时速度也较慢,我真的没想到,因为它是从Azure到Azure以及同一组织内的连接.在这种情况下,使用提要而不是Maven Central至少要花费两倍的时间.每次都是如此,因为每次构建时Azure Pipelines都会为您提供一个新的VM(我使用的是托管代理),因此在这种情况下没有依赖项缓存.

But the issue is that it's also slower when building my project from Azure Pipelines, which I really didn't expect since it's a connection from Azure to Azure and within the same organization. In this case, it takes at least twice the time when using the feed rather than maven central. And this will be true every time since Azure Pipelines gives you a fresh VM each time you build (I'm using a hosted agent), so there's no dependencies caching in this case.

这真的很烦人,因为到目前为止我的项目还只是一个HelloWorld,所以随着时间的推移只会变得更糟.

It's really annoying since my project is just a HelloWorld so far, so it will only get worse over time.

使用仓库管理器/提要是Maven和Azure的最佳实践,但是目前,我真的在考虑从Maven中心(而不是提要)获取所有内容的坏习惯,至少在我看来管道,以提高性能.

Using a repository manager/feed is the best practice according to both Maven and Azure, but at this point I'm really thinking of going for the bad practice of getting everything from maven central instead of my feed, at least in my pipeline, to improve the performance.

我是唯一一个遇到此问题的人吗?您对此有何看法?

Am I the only one having this issue ? What are your thoughts about this ?

推荐答案

最后,最近阅读了Azure Pipelines的文档后,我发现有一种方法可以在两次运行之间缓存Maven存储库,因此它可以部分解决我的问题,因为完全下载依赖项只会发生一次.这是文档对于那些有兴趣的人来说是个问题.

Finally, after diving into the documentation for Azure Pipelines recently, I found out there is a way to cache the maven repository between runs so it partially solves my issue since the full download of the dependencies will happen only once. Here is the doc in question for those who are interested.

这篇关于Azure Artifacts Feed比Maven Central慢得多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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