Maven:依赖项:get -DoutputDirectory不起作用.(如何将工件及其所有依赖项下载或复制到特定文件夹?) [英] Maven: dependency:get -DoutputDirectory doesn't work. (How to download or copy an artifact with all its dependencies to specific folder?)

查看:110
本文介绍了Maven:依赖项:get -DoutputDirectory不起作用.(如何将工件及其所有依赖项下载或复制到特定文件夹?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试以下方法,但不起作用.

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

有人知道实现我目标的另一种方法吗?

我的目标是将包含所有依赖项的工件下载到一个文件夹中.

dpendency:copy-dependencies命令仅复制jar文件,但是我想拥有一个具有其所有依赖项的构件,例如本地存储库文件夹结构.例如,下面的照片显示了

我通过此工件下载了其所有依赖项都带有dependency:get命令,然后将其存储在本地存储库中,并与本地存储库中的其他文件夹合并.

如何将此工件及其所有依赖项从本地存储库(或maven存储库)复制到另一个文件夹.

我不想使用dependency:copy-dependencies命令,因为它只复制jar文件,但是我想要文件和文件夹,因为它们是使用dependency:get命令下载的(例如本地存储库文件夹结构)./p>

不幸的是,以下命令不在我想要的位置存储文件和文件夹.

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

解决方案

  mvn -Dmaven.repo.local = someDir依赖项:get ... 

?

您可以在命令行上将任何目录指定为本地存储库,因此 dependency:get 会将结果复制到该目录.

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

解决方案

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.

这篇关于Maven:依赖项:get -DoutputDirectory不起作用.(如何将工件及其所有依赖项下载或复制到特定文件夹?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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