错误是
[INFO] --- appengine-maven-plugin:2.8.1:deploy (default-cli) @ licence-server ---
[INFO] Staging the application to: c:\Source\wylas\wylas-licence-server\server\licence-server\target\appengine-staging
[INFO] Detected App Engine appengine-web.xml based application.
[INFO] Deleting the staging directory: c:\Source\wylas\wylas-licence-server\server\licence-server\target\appengine-staging
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.081 s
[INFO] Finished at: 2024-12-05T11:06:44+10:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:2.8.1:deploy (default-cli) on project licence-server: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:2.8.1:deploy failed: com.google.cloud.tools.appengine.operations.cloudsdk.AppEngineJavaComponentsNotInstalledException: Validation Error: Java App Engine components not installed. Fix by running 'gcloud components install app-engine-java' on command-line. -> [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
GCloud 组件版本:
c:\Source\wylas\wylas-licence-server\server\licence-server>gcloud version
Google Cloud SDK 502.0.0
app-engine-java 2.0.31
app-engine-python 1.9.114
beta 2024.11.15
bq 2.1.9
cloud-datastore-emulator 2.3.1
core 2024.11.15
gcloud-crc32c 1.0.0
gsutil 5.31
Java版本
c:\Source\wylas\wylas-licence-server\server\licence-server>java --version
openjdk 17.0.5 2022-10-18
OpenJDK Runtime Environment OpenLogic-OpenJDK (build 17.0.5+8-adhoc..jdk17u)
OpenJDK 64-Bit Server VM OpenLogic-OpenJDK (build 17.0.5+8-adhoc..jdk17u, mixed mode)
Maven版本
c:\Source\wylas\wylas-licence-server\server\licence-server>mvn -v
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: C:\Dev\apache-maven-3.9.9
Java version: 17.0.8, vendor: OpenLogic, runtime: C:\Dev\jdk-17.0.8.7
Default locale: en_AU, platform encoding: Cp1252
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
NB 尝试更新 GCloud Java 组件给出:
c:\Source\wylas\wylas-licence-server\server\licence-server>gcloud components install app-engine-java
All components are up to date.
有解决办法吗?
本例中的问题是 GCloud SDK 安装文件夹已损坏。
解决方案是将 GCloud SDK 安装到新文件夹中,并将 appengine-maven-plugin 的“cloudSdkHome”参数更改为新位置。