2014-11-06 51 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>