Maven: dependency:get -DoutputDirectory doesn't work. (How to download or copy an artifact with all its dependencies to specific folder?)

倖福魔咒の 提交于 2019-12-13 18:22:18

问题


I try the following way but it doesn't work.

mvn dependency:get -Dartifact=com.android.tools.build:gradle:3.4.0-alpha07 -DoutputDirectory=C:\Users\username\Desktop\MyFolder

Does anyone know another way of achieving my goal?

My goal is to download an artifact with all its dependencies in a folder.

The dpendency:copy-dependencies command only copies jar files, but I want to have an artifact with all its dependencies like the local repository folder structure. for example the photo below shows an artifact with all its dependencies that have been downloaded from the maven repository (I want this).

I download this artifact with all its dependencies with dependency:get command and then be stored in the local repository and combined with other folders that are in the local repository.

How am I to copy this artifact, along with all its dependencies from the local repository (or maven repository) to another folder.

I don't want to use the dependency:copy-dependencies command because it only copies jar files, but I want files and folders, as they are downloaded with dependency:get command (like the local repository folder structure).

Unfortunately, the following command does not store files and folders in the location I want.

mvn dependency:get -Dartifact=com.android.tools.build:gradle:3.4.0-alpha07 -DoutputDirectory=C:\Users\username\Desktop\MyFolder


回答1:


What about

mvn -Dmaven.repo.local=someDir dependency:get ...

?

You can specify any directory as local repository on the command line, so dependency:get will copy the results to that directory.



来源:https://stackoverflow.com/questions/54276515/maven-dependencyget-doutputdirectory-doesnt-work-how-to-download-or-copy-a

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