【问题标题】:Cannot deploy Java WAR application without app.yml file on GAE无法在 GAE 上部署没有 app.yml 文件的 Java WAR 应用程序
【发布时间】:2020-03-18 21:58:32
【问题描述】:

我有一个 SpringBoot Application ant,它部署在 Google App Engine 上,我之前使用 google cloud maven 插件部署了很多次(158),但是今天我的核心和部署规则没有任何变化,我收到了下一条错误消息:

INFO: submitting command: /root/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/bin/gcloud app deploy --promote --version 1 --project <my-project-name> --credential-file-override /app/keys/<my-key>.json
GCLOUD: ERROR: (gcloud.app.deploy) Failed to parse YAML from [gs://runtime-builder/experiments.yaml]: mapping values are not allowed here
GCLOUD:   in "<file>", line 2, column 14

在我的项目中我没有 yml 配置,因为它是 java 我只有 appengine-web.xml 配置。

对此有什么想法吗??

提前致谢

更新:我正在使用 appengine-maven-plugin,并且我有下一个配置:

<plugin>
  <groupId>com.google.cloud.tools</groupId>
  <artifactId>appengine-maven-plugin</artifactId>
  <version>2.2.0</version>
  <configuration>
    <version>${app.target.version}</version>
    <promote>${app.promote.version}</promote>
    <projectId>${gae.app.name}</projectId>
    <serviceAccountKeyFile>${gae.key.location}</serviceAccountKeyFile>
  </configuration>
</plugin>

[解决方案] 1.降级插件版本 2.设置较旧的gCloud SDK

最终配置:

<plugin>
    <groupId>com.google.cloud.tools</groupId>
    <artifactId>appengine-maven-plugin</artifactId>
    <version>2.0.0-rc5</version> <!-- Downgraded -->
    <configuration>
      <version>${app.target.version}</version>
      <promote>${app.promote.version}</promote>
      <projectId>${gae.app.name}</projectId>
      <serviceAccountKeyFile>${gae.key.location}</serviceAccountKeyFile>
      <cloudSdkVersion>271.0.0</cloudSdkVersion> <!-- Set older sdk version -->
    </configuration>
  </plugin>

【问题讨论】:

    标签: java spring-boot google-app-engine appengine-maven-plugin


    【解决方案1】:

    可能重复:Can't deploy to app engine standard with gcloud components 272.0.0

    你可以试试这个:

    这里有同样的问题。到目前为止,唯一的方法是恢复到旧版本。

    gcloud 组件更新 --version=271.0.0

    截至下午 1.55(PDT),它似乎已修复在最新版本上。您可以再次更新到最新版本!

    【讨论】:

    • 非常感谢,另外我必须降级 maven 插件版本,它可以工作。我将使用最终配置更新我的答案。
    • 截至下午 1.55(太平洋夏令时间),它似乎已修复在最新版本上。您可以再次更新到最新版本!
    猜你喜欢
    • 2016-08-28
    • 2018-12-08
    • 2017-09-02
    • 2011-01-14
    • 1970-01-01
    • 2012-11-19
    • 1970-01-01
    • 2012-01-24
    • 2019-10-01
    相关资源
    最近更新 更多