3
我使用命令行中的maven-dependency-plugin来下载单个文件,但它总是在我的本地存储库中,对于我的特殊用例,我希望它是下载到当前目录。Maven依赖项插件忽略目标
我使用插件的版本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
...但得到这个...
[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
我做错了什么?
+1。这样可行。 – Yanflea 2012-02-23 14:59:33
啊,谢谢你指出。我以前的工作是假设预期的表达式始终与参数名称相同。 :-) – RCross 2012-02-23 15:23:45