Maven依赖插件忽略目标

RCr*_*oss 3 java maven maven-dependency-plugin

我正在使用命令行中的maven-dependency-plugin来下载单个文件,但是在我的本地存储库中,对于我的特定用例,我希望将它下载到当前目录.

我正在使用该插件的2.4版,它应该支持-Ddestination作为备用下载站点; 但是,我无法让它发挥作用.在调试模式下运行maven似乎表明目标参数被忽略...

我正在运行以下内容:

M:\>mvn -e -X org.apache.maven.plugins:maven-dependency-plugin:2.4:get \
-Ddestination=M:\test \
-DremoteRepositories=http://nexus-repo:8080/nexus/content/repositories/snapshots \
-Dartifact=com.company.Common:CommonLibs:1.12.0-SNAPSHOT:tar \
-Dtransitive=false
Run Code Online (Sandbox Code Playgroud)

......但得到这个......

[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-dependency-plugin:2.4:get' -->
[DEBUG]   (f) artifact = com.company.Common:CommonLibs:1.12.0-SNAPSHOT:tar
[DEBUG]   (f) localRepository = Repository[local|file://C:\Subversion\LocalMavenRepo]
[DEBUG]   (f) packaging = jar
[DEBUG]   (f) pomRemoteRepositories = [Repository[central|http://repo1.maven.org/maven2]]
[DEBUG]   (f) remoteRepositories = http://nexus-repo:8080/nexus/content/repositories/snapshots
[DEBUG]   (f) repositoryId = temp
[DEBUG]   (f) transitive = false
[DEBUG] -- end configuration --
[INFO] [dependency:get {execution: default-cli}]
[DEBUG] Skipping disabled repository central
[INFO] snapshot com.company.Common:CommonLibs:1.12.0-SNAPSHOT: checking for updates from temp
[DEBUG] Using Wagon implementation lightweight from default mapping for protocol http
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

kan*_*kan 8

请查看此处的文档.它说:

表达式:$ {dest}

这意味着您必须提供名为的参数dest.尝试使用-Ddest=M:\test.tar.此外,它应该是下载的artefact的文件名,而不是目录.