2014-11-06 48 views
1

我試圖將Objectify添加到我的Google App Engine項目中。我按照https://code.google.com/p/objectify-appengine/wiki/MavenRepository的說明來添加依賴到我的pom.xml。構建失敗解決Objectify依賴關係

我複製並粘貼到依賴我的pom.xml但是當我執行mvn clean install我得到了以下錯誤:

[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.796 s 
[INFO] Finished at: 2014-11-06T15:34:45-08:00 
[INFO] Final Memory: 8M/156M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal on project nbsocialmetrics-frontend: Could not resolve dependencies for project com.netbase.nbsocialmetrics:nbsocialmetrics-frontend:war:1.0: Failed to collect dependencies at com.googlecode.objectify:objectify:jar:check for latest version: Failed to read artifact descriptor for com.googlecode.objectify:objectify:jar:check for latest version: Could not transfer artifact com.googlecode.objectify:objectify:pom:check for latest version from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 76: http://repo.maven.apache.org/maven2/com/googlecode/objectify/objectify/check for latest version/objectify-check for latest version.pom -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[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 read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException 
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command 
[ERROR] mvn <goals> -rf :nbsocialmetrics-frontend 

回答

0

上述問題的解決辦法是複製和粘貼,然後修改版本號。這是因爲在https://code.google.com/p/objectify-appengine/wiki/MavenRepository書面原依賴性:

<dependencies> 
    <dependency> 
     <groupId>com.googlecode.objectify</groupId> 
     <artifactId>objectify</artifactId> 
     <version>check for latest version</version> 
    </dependency> 
    </dependencies> 

我沒注意到是文本「檢查最新版本」的字符串。所以我點擊http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.googlecode.objectify%22,然後能夠看到最新版本,在這個時候,是5.1.1。

所以我進入這個到我的pom.xml代替,然後mvn clean install工作:

<dependencies> 
    <dependency> 
     <groupId>com.googlecode.objectify</groupId> 
     <artifactId>objectify</artifactId> 
     <version>5.1.1</version> 
    </dependency> 
    </dependencies>