【问题标题】:Couldn't Generate the Client Library for the Endpoints API无法为 Endpoints API 生成客户端库
【发布时间】:2015-08-03 15:33:34
【问题描述】:

以下命令运行良好:
- mvn clean install
- mvn appengine:devserver
- mvn appengine:update

但是当我尝试以下命令时:
mvn -e appengine:endpoints_get_client_lib

我收到以下错误(命令 reinvent a JAVA_HOME)。 感谢支持

Aug 03, 2015 5:26:54 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed /home/space2m/mvnworkspace/ovinto/target/generated-sources/appengine-endpoints/WEB-INF/appengine-web.xml
API client library written to /home/space2m/mvnworkspace/ovinto/target/generated-sources/appengine-endpoints/WEB-INF/ovinto-v1-java.zip
[INFO] BUILDING Endpoints Client Library from: /home/space2m/mvnworkspace/ovinto/target/endpoints-client-libs/ovinto/pom.xml
Error: JAVA_HOME is not defined correctly.
  We cannot execute /usr/lib/jvm/java-7-oracle/bin/java/bin/java
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.191 s
[INFO] Finished at: 2015-08-03T17:26:56+01:00
[INFO] Final Memory: 17M/90M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.24:endpoints_get_client_lib (default-cli) on project ovinto: Execution default-cli of goal com.google.appengine:appengine-maven-plugin:1.9.24:endpoints_get_client_lib failed: Build failed. -> [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/PluginExecutionException

【问题讨论】:

标签: google-app-engine maven


【解决方案1】:

根据我的研究,mvn 脚本(至少在我的 maven 3.2.1 版本中)存在一个问题,它将 JAVA_HOME 更改为 JAVA_HOME/bin/java 在运行实际的 mvn 命令之前。

我刚刚在 mvn (linux) 中添加了以下注释

#JAVA_HOME=`readlink -f "$JAVACMD" | sed "s:/jre/bin/java::"`

(大约在第 170 行)

现在可以使用了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-11
    • 2023-01-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多