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