失败:(ID:838926df)没有找到任何带有 Main-Class 清单条目的 jar 文件

Failure: (ID: 838926df) did not find any jar files with a Main-Class manifest entry

当 运行 gcloud app deploy 在我的 spring 启动应用程序上时,此错误发生在 Cloud Build 中。

不小心把maven插件删了,别删

      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>

可能有一个或多个问题导致您收到此错误。 要解决问题,请检查以下内容 -

  1. 您的 app.yaml 应具有如下入口点和运行时信息 -

    runtime: java11
    entrypoint: java -Xmx64m -jar blahblah.jar

  2. 你的pom.xml应该有appengine maven插件依赖

`

<plugin>
   <groupId>com.google.cloud.tools</groupId>    
   <artifactId>appengine-maven-plugin</artifactId>
   <version>2.2.0</version>
</plugin>

`

  1. 如果你想替换任何配置使用命令不要修改 jar -
    jar uf blahblah.jar filename.yaml

  2. 确保你在 pom.xml 中有像这样的罐子包装 - <packaging>jar</packaging>

尝试在pom.xml打包成war文件时注释掉,例如:

<!--  <packaging>war</packaging> -->

它为我解决了这个问题。好的最小+可行示例在这里:https://codelabs.developers.google.com/codelabs/cloud-app-engine-springboot#0

我能够通过添加

为我的 AppEngine + Gradle 项目修复它
jar {
    enabled = false
    archiveClassifier = ''
}

到 build.gradle 文件。