将所有maven依赖关系下载到不在存储库中的目录? [英] Downloading all maven dependencies to a directory NOT in repository?

查看:131
本文介绍了将所有maven依赖关系下载到不在存储库中的目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始将我的项目转换为maven,因为我需要使用一个以二进制格式分发的图书馆,但是在我的头撞到墙上太久以后,我决定停止伤害自己只需使用Ant。我想让maven将jar及其所有的传递依赖关系下载到我所选择的目录中,所以我可以像我一般喜欢的那样检查它们进入我的SCM,再次成为一个幸福的开发人员。

任何想法如何轻松实现?

I started to convert my project to maven because I needed to use a library that was distributed in binary form over maven only, but after banging my head against the wall on it for far too long I've decided to stop hurting myself and just use Ant. I'd like to just have maven download the jar and all of its transitive dependencies into a directory of my choosing so I can just check them into my SCM as I normally enjoy and be a blissful developer once again.
Any ideas how to do that easily?

推荐答案

maven依赖插件可以解决您的问题。

如果你有一个 pom 创建与您指定的所有项目依赖关系,所有您需要做的是运行 mvn依赖关系:copy-dependencies ,你会发现包含所有依赖关系的 target / dependencies 文件夹,包括传递。

If you have a pom created with all your project dependencies specified, all you would need to do is run mvn dependency:copy-dependencies and you will find target/dependencies folder filled with all the dependencies, including transitive.

这篇关于将所有maven依赖关系下载到不在存储库中的目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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