以下命令正常工作:
- mvn clean install
- mvn appengine:devserver
- mvn appengine:update
但是当我尝试以下命令时:
mvn -e appengine:endpoints_get_client_lib
我收到以下错误(命令重新发明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
答案 0 :(得分:0)
根据我的研究,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行附近)
现在有效。