如何在不使用dependency:get或maven-download-plugin的情况下从命令行下载Maven工件? [英] How do I download a Maven artifact at the command line without using dependency:get or maven-download-plugin?
问题描述
我想在命令行中下载工件及其依赖项.即
I'd like to download an artifact and its dependencies at the command line. I.e.
mvn [some plugin]:[goal] -DartifactId=[artifactId] -DgroupId=[groupId] -Dversion=[version]
我尝试了mvndependency:get,但这似乎需要远程存储库的列表.我希望mvn使用settings.xml中已指定的内容
I've tried mvn dependency:get but this seems to require a list of remote repositories. I want mvn to use what's already specified in settings.xml
我还尝试了 maven-download-plugin ,但这似乎无法正常工作(它尝试将xerces-impl下载为ant的传递依赖项,但未能解决.xerces-impl和ant都不是我的工件的依赖项.)
I've also tried the maven-download-plugin but this doesn't seem to work properly (it tried downloading xerces-impl as a transitive dependency of ant and failed to resolve it. Neither xerces-impl nor ant are dependencies of my artifact).
您的帮助将不胜感激.
推荐答案
尝试使用最新版本的dependency:get,它对我有用
Try using the latest version of dependency:get, it works for me
mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get -DartifactId=[artifactId] -DgroupId=[groupId] -Dversion=[version]
为我工作
这篇关于如何在不使用dependency:get或maven-download-plugin的情况下从命令行下载Maven工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!