2012-10-06 31 views
1

我有一個maven項目和一個帶有外部jar文件的項目庫。 我使用install命令將jar文件安裝到目錄庫 中,當我檢入存儲庫時,安裝了jar文件 我還在pom文件中添加了依賴項配置。 但是,當我運行mvn編譯文件。 我得到MVN無法解決依賴Maven無法解決本地依賴問題

這是雙龍段錯誤:

 <repository> 
    <id>repo</id> 
    <releases> 
     <enabled>true</enabled> 
     <checksumPolicy>ignore</checksumPolicy> 
    </releases> 
    <snapshots> 
     <enabled>false</enabled> 
    </snapshots> 
    <url>file://${project.basedir}/repo</url> 
</repository> 

這是POM的依賴

<dependency> 
     <groupId>Com.RubineEngine.GesturePoints</groupId> 
     <artifactId>Com-RubineEngine-GesturePoints</artifactId> 
     <version>1.0-SNAPSHOT</version> 
    </dependency> 

這是錯誤消息:

[INFO] Final Memory:6M/309M

[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal on project com-boundingbox-box: Could not resolve 
dependencies for project com.boundingbox.box:com-boundingbox-box:jar:1.0-SNAPSH 
OT: Could not find artifact Com.RubineEngine.GesturePoints:Com-RubineEngine-Gest 
urePoints:jar:1.0-SNAPSHOT -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit 
ch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso 
lutionException 

有沒有人對這個錯誤有任何建議。

這是使用U後的錯誤消息,並且X開關

[DEBUG] ======================================================================= 
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for file://C:\U 
sers\FAISAL\Desktop\disaster\com-initialtheta-theta/repo 
Downloading: file://C:\Users\FAISAL\Desktop\disaster\com-initialtheta-theta/repo 
/Com/RubineEngine/GesturePoints/Com-RubineEngine-GesturePoints/1.0-SNAPSHOT/mave 
n-metadata.xml 
[DEBUG] Writing resolution tracking file C:\Users\FAISAL\.m2\repository\Com\Rubi 
neEngine\GesturePoints\Com-RubineEngine-GesturePoints\1.0-SNAPSHOT\resolver-stat 
us.properties 
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo 
.typesafe.com/typesafe/releases/ 
Downloading: http://repo.typesafe.com/typesafe/releases/Com/RubineEngine/Gesture 
Points/Com-RubineEngine-GesturePoints/1.0-SNAPSHOT/maven-metadata.xml 
[DEBUG] Writing resolution tracking file C:\Users\FAISAL\.m2\repository\Com\Rubi 
neEngine\GesturePoints\Com-RubineEngine-GesturePoints\1.0-SNAPSHOT\resolver-stat 
us.properties 
[DEBUG] Could not find metadata Com.RubineEngine.GesturePoints:Com-RubineEngine- 
GesturePoints:1.0-SNAPSHOT/maven-metadata.xml in typesafe (http://repo.typesafe. 
com/typesafe/releases/) 
[DEBUG] Could not find metadata Com.RubineEngine.GesturePoints:Com-RubineEngine- 
GesturePoints:1.0-SNAPSHOT/maven-metadata.xml in lib (file://C:\Users\FAISAL\Des 
ktop\disaster\com-initialtheta-theta/repo) 
[DEBUG] Skipped remote update check for Com.RubineEngine.GesturePoints:Com-Rubin 
eEngine-GesturePoints:1.0-SNAPSHOT/maven-metadata.xml, already updated during th 
is session. 
[DEBUG] Failure to find Com.RubineEngine.GesturePoints:Com-RubineEngine-GestureP 
oints:1.0-SNAPSHOT/maven-metadata.xml in http://repo.typesafe.com/typesafe/relea 
ses/ was cached in the local repository, resolution will not be reattempted unti 
l the update interval of typesafe has elapsed or updates are forced 
[DEBUG] Skipped remote update check for Com.RubineEngine.GesturePoints:Com-Rubin 
eEngine-GesturePoints:1.0-SNAPSHOT/maven-metadata.xml, already updated during th 
is session. 
[DEBUG] Failure to find Com.RubineEngine.GesturePoints:Com-RubineEngine-GestureP 
oints:1.0-SNAPSHOT/maven-metadata.xml in file://C:\Users\FAISAL\Desktop\disaster 
\com-initialtheta-theta/repo was cached in the local repository, resolution will 
not be reattempted until the update interval of lib has elapsed or updates are 
forced 

貌似系統越來越兩個儲存庫之間混淆。

回答

2
  1. 檢查,在groupId/artifactId的是在您的項目庫中庫的POM文件設置正確(即$ {project.baseDir} \回購的\ com .... \ 1.0快照\ Com-RubineEngine-GesturePoints.pom)
  2. 爲了擺脫「解析將不會重新嘗試,直到lib的更新間隔已經過去或更新被迫」錯誤,您需要從本地存儲庫中刪除文件夾(通常〜/ .m2),即〜/ .m2/Com/RubineEngine。
+0

謝謝。經過幾個小時後感到沮喪和困惑,我的問題解決了。沒有2.是我的原因。 – Thupten

1

嘗試將啓用的快照更改爲true。

<snapshots> 
     <enabled>true</enabled> 
</snapshots> 
+0

只是將啓用的快照更改爲true,但運行編譯時仍然出現相同的錯誤。你有沒有其他可能的建議。 –

+0

嘗試執行'mvn help:effective-pom'並查看repo的url是否指向正確的。 –

+0

當我使用mvn help:effective-pom命令時,我得到了構建成功消息。希望這是你所建議的 –