我正在尝试将Objectify添加到我的Google App Engine项目中。我按照https://code.google.com/p/objectify-appengine/wiki/MavenRepository上的说明进行操作,该说明为我的pom.xml添加依赖项。
我将依赖项复制并粘贴到我的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 :(得分: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>
我没注意到的是文字串&#34;检查最新版本&#34;。所以我点击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>