How to get all the specified jars mentioned in the pom.xml and transitively dependent jars?

霸气de小男生 提交于 2019-12-22 11:29:10

问题


I have only the POM file using which I need to write a script to automatically download all the dependency files and output to custom mentioned path.

I just want to achieve the above using mvn command in command line.


回答1:


It sounds like you're looking for mvn dependency:copy-dependencies:

dependency:copy-dependencies takes the list of project direct dependencies and optionally transitive dependencies and copies them to a specified location, stripping the version if desired. This goal can also be run from the command line.

From the project root, invoking on the command line

mvn dependency:copy-dependencies -DoutputDirectory=...

will copy all your project direct and transitive dependencies to the specified output directory. If those dependencies are not already in your local Maven repository, they will be downloaded from Maven Central (or from a custom repository).



来源:https://stackoverflow.com/questions/34694214/how-to-get-all-the-specified-jars-mentioned-in-the-pom-xml-and-transitively-depe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!