Spring Boot 构建正常,但 Heroku 部署失败

订购区

我已经广泛查找了这个问题,但没有找到有用的答案。我正在尝试使用 Heroku部署此 API这是一个预先存在的 GitHub 存储库,我遵循了 Heroku 的开发中心指南。我尝试通过 Git 和 Heroku Maven 插件进行部署,结果是一样的:我可以在本地构建它,一切都很好,但是当我 cd 到~/workspace/API/myapi/并尝试将它推送到 Heroku 时,git push heroku main:main我得到:

Enumerating objects: 237, done.
Counting objects: 100% (237/237), done.
Delta compression using up to 4 threads
Compressing objects: 100% (179/179), done.
Writing objects: 100% (237/237), 91.06 KiB | 4.14 MiB/s, done.
Total 237 (delta 61), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Java app detected
remote: -----> Installing JDK 11... done
remote: -----> Executing Maven
remote:        $ ./mvnw -DskipTests clean dependency:list install
remote: ./mvnw: 219: ./mvnw: cannot open /tmp/build_f4dfb6d1/API/myapi/.mvn/wrapper/maven-wrapper.properties: No such file
remote: /tmp/build_f4dfb6d1/API/myapi/.mvn/wrapper/maven-wrapper.jar: No such file or directory
remote: Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain
remote: Caused by: java.lang.ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain
remote: 
remote:  !     ERROR: Failed to build app with Maven
remote:        We're sorry this build is failing! If you can't find the issue in application code,
remote:        please submit a ticket so we can help: https://help.heroku.com/
remote: 
remote:  !     Push rejected, failed to compile Java app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to myapiheroku.
remote: 
To https://git.heroku.com/cashonlineheroku.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapiheroku.git'
  • /home/myuser/workspace/API/myapi/.mvn/wrapper/包含文件maven-wrapper.jar,maven-wrapper.propertiesMavenWrapperDownloader.java.
  • /home/myuser/workspace/API/myapi/system.properties指定
    java.runtime.version=11.
  • /home/myuser/.m2/repository/ar/com/api/myapi/包含
    myapi.0.0.1-SNAPSHOT.jar.
  • 您可以在上面链接的存储库中找到pom.xmlapplication.properties等。

我错过了什么?如果您需要其他信息,请告诉我。提前致谢!

马拉克斯

看起来mvnw您的项目目录的根目录中有一个文件,但缺少 Maven 包装器所需的其他文件。这些通常驻留在.mvn/wrapper您的应用程序目录中。你可能已经删除了它们。

您有两个选择:

  1. 删除 Maven Wrapper 的其他文件:mvnwmvnw.cmd
  2. 为 Maven Wrapper 重新安装丢失的文件: mvn -N io.takari:maven:0.7.7:wrapper

我会选择选项 2。通常首选使用包装器来确保您的项目使用您期望的 Maven 版本运行。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Spring Boot + Angle 2 Heroku部署

在Heroku上部署Spring Boot App-构建成功,但是:无法提供页面

成功部署后,Heroku构建失败

Rails部署到Heroku构建失败

Spring Boot:成功部署后出现 Heroku 错误

Heroku无法部署Java 11 Spring Boot App

将可运行的 Spring Boot jar 部署到 Heroku

无法将Spring Boot应用程序部署到heroku

Spring boot 在heroku上部署时绑定到cloudmaqp错误

如何在 Spring Boot 上读取 Heroku 部署的静态文件

将 Spring App 部署到 Heroku 时失败

Heroku Spring Boot启动

部署 WAR 时 Spring-Boot 模板解析失败

在 heroku 上部署失败

带有Spring-Cloud的Spring Boot:gradle构建失败

如何使用Spring Boot将使用Postgresql的Spring应用程序部署到Heroku?

Tomcat上的Spring Boot War部署无法正常工作

Spring Boot Tomcat部署无法正常工作Tomcat 7

如何将Spring Boot应用程序项目部署到Heroku

将Spring Boot应用程序部署到Heroku时出现SQLSyntaxErrorException

带有 Maven 应用程序的 Spring Boot 的 Heroku jar 部署给出代码 = H10

将Spring Boot应用程序部署到Heroku时出错

外部Jars部署在heroku中的Spring Boot应用程序中

在Heroku上部署Spring Boot时的Google API重定向问题

使用特定的application.properties文件将Spring Boot应用程序部署到Heroku

部署到Heroku的Spring Boot应用未找到其百里香叶视图

无法使用 bitbucket 管道在 Heroku 中部署 spring-boot 应用程序

为什么我的简单 Spring Boot 应用程序无法在 Heroku 上部署?

使用github使用Docker将Spring boot App部署到Heroku