简体   繁体   English

将罐子从Maven存储库下载到本地目录

[英]download a jar from maven repository to a local directory

How to download a jar from central repository to a local directory. 如何将jar从中央存储库下载到本地目录。 I'm using maven 3.04 我正在使用Maven 3.04

I used following command 我使用以下命令

mvn dependency:get -X -DrepoUrl={url} -Dartifact=groupId:artifactId:LATEST -DoutputDirectory=$(pwd) mvn依赖项:get -X -DrepoUrl = {url} -Dartifact = groupId:artifactId:LATEST -DoutputDirectory = $(pwd)

the jar is being downloaded into local repository , .m2 directory but not to the directory specified. 该jar将下载到本地存储库.m2目录中,但不会下载到指定的目录中。

I tried using mvn dependency:copy but it asks for a pom.xml which I don't want to write 我尝试使用mvndependency:copy,但它要求一个我不想写的pom.xml

dependency:get has -Ddest instead of -DoutputDirectory option, but it's deprecated with a note that you should use dependency:copy . dependency:get具有-Ddest而不是-DoutputDirectory选项,但已过时,但应注意您应使用dependency:copy

dependency:copy works fine without pom.xml, you just need to provide it all required parameters, eg: dependency:copy没有pom.xml的情况下可以正常工作,您只需要提供所有必需的参数即可,例如:

mvn dependency:copy -Dartifact=org.apache.maven.plugins:maven-dependency-plugin:2.10 -DoutputDirectory=.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM