2012-09-29 38 views
0

我想在pom.xml文件的依賴關係中添加一個hibernate-distribution.jar版本3.5.4-Final。當我發出這個命令,mvn eclipse:eclipse -Dwtpversion=2.0,我得到以下輸出。當我檢查我的.m2/repository文件夾時,我沒有看到hibernate-distribution.jar是下載的。我可以知道如何使用mvn命令下載jar文件嗎?爲什麼mvn命令不能下載hibernate-distribution.jar文件?

[INFO] Scanning for projects... 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Web3 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] >>> maven-eclipse-plugin:2.9:eclipse (default-cli) @ Web3 >>> 
[INFO] 
[INFO] <<< maven-eclipse-plugin:2.9:eclipse (default-cli) @ Web3 <<< 
[INFO] 
[INFO] --- maven-eclipse-plugin:2.9:eclipse (default-cli) @ Web3 --- 
[INFO] Adding support for WTP version 2.0. 
[INFO] Using Eclipse Workspace: C:\Documents and Settings\kok.hoe.loh\workspace 
[WARNING] Workspace defines a VM that does not contain a valid jre/lib/rt.jar: C 
:\Program Files\Java\jre6 
[INFO] no substring wtp server match. 
[INFO] Using as WTP server : JBoss v4.2 
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAIN 
ER 
[INFO] Unable to read jar manifest from C:\Documents and Settings\kok.hoe.loh\.m 
2\repository\org\hibernate\hibernate-distribution\3.5.4-Final\hibernate-distribu 
tion-3.5.4-Final.pom 
[INFO] File C:\Documents and Settings\kok.hoe.loh\workspace\Web3\.project alread 
y exists. 
     Additional settings will be preserved, run mvn eclipse:clean if you want 
old settings to be removed. 
[INFO] Wrote Eclipse project for "Web3" to C:\Documents and Settings\kok.hoe.loh 
\workspace\Web3. 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 18.418s 
[INFO] Finished at: Sat Sep 29 11:11:01 SGT 2012 
[INFO] Final Memory: 6M/15M 
[INFO] ------------------------------------------------------------------------ 
+0

'mvn eclipse:eclipse'命令不會下載庫,它只是創建配置文件來導入你的項目到eclipse中。嘗試'mvn compile'來編譯你的項目,它會自動下載你的庫 – yodamad

+0

如果你使用的是m2e,那麼不要再使用mvn maven-eclipse-plugin。 – khmarbaise

+0

可以幫助[http://stackoverflow.com/questions/7074040/maven-failing-to-download-jar-dependencies][1] [1]:http://stackoverflow.com/問題/ 7074040/Maven的失敗到下載JAR依賴性 – Himanshu

回答

0

這將下載您新添加到POM

mvn eclipse:eclipse -DdownloadSources=true 
2

嘗試刪除以下目錄中的文件:

C:\Documents and Settings\kok.hoe.loh\.m2\repository\org\hibernate\ 

然後再次運行以下命令:

mvn eclipse:eclipse -Dwtpversion=2.0 
0

我有同樣的我ssue當我試圖通過依賴而不是在pom.xml文件中使用dependencyManagement標籤導入

相關問題