Maven-依赖清单和下载工件

发布于 2025-02-12 07:38:38 字数 86 浏览 0 评论 0原文

是否可以在MVN依赖项等MAVEN项目中找到所有依赖项:TREE,将结果保存到文件,然后使用MVN命令从命令行中的列表文件下载所有依赖项?

谢谢

Is it possible to find all dependencies in a maven projects like mvn dependency:tree, save results to file and then use mvn command for download all dependencies from list file in command line?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

永言不败 2025-02-19 07:38:38

根据我的经验,各种插件不会获得100%的覆盖范围,因此构建将失败。对我有用的是从一个空的.m2/存储库文件夹开始,然后执行您需要执行的maven命令,然后坚持现在填充的.m2/repositories文件夹。

我尝试将其转换为项目本身中的本地文件存储库,以便我们可以使用离线构建来进行,但是对于我们的目的来说,这太大了。今天可能不是那么障碍。

除非您有非常严格的政治要求,否则通常的务实解决方案是在您的网络上拥有一个本地存储库,例如Nexus或Mantifactory Morirorming Maven Central,然后将其作为镜子访问。

In my experience the various plugins do not get a 100% coverage so the builds will fail. What worked for me, was to start with an empty .m2/repositories folder, and then do the maven commands you need to do, and then persist the now populated .m2/repositories folder.

I experimented with converting it to a local file repository in the project itself so we could do with offline builds, but this turned out to be too big for our purposes. It might not be that much of an obstacle today.

Unless you have very strict political requirements, the usual pragmatic solution is to have a local repository on your network like nexus or artifactory mirroring maven central which is then accessed as a mirror.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文