简体   繁体   English

git 推送 heroku 主拒绝

[英]git push heroku master rejected

I want to deploy my first springboot app with mysql to heroku (using git and heroku cli), but failed when running git push heroku master rejected. I want to deploy my first springboot app with mysql to heroku (using git and heroku cli), but failed when running git push heroku master rejected.

remote:        [INFO] Changes detected - recompiling the module!
remote:        [INFO] Compiling 7 source files to /tmp/build_c5e0f2b5/target/classes
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] BUILD FAILURE
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] Total time:  8.934 s
remote:        [INFO] Finished at: 2022-07-27T16:58:41Z
remote:        [INFO] ------------------------------------------------------------------------
remote:        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project MyWebApp: Fatal error compiling: invalid target release: 18 -> [Help 1]
remote:        [ERROR]
remote:        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote:        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote:        [ERROR]
remote:        [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote:        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
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:  !
remote:  ! ## Warning - The same version of this code has already been built: ff84352b22a5ff214782161029fd4ff8ec067734
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version ff84352b22a5ff214782161029fd4ff8ec067734
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to aien-app-1.
remote:
To https://git.heroku.com/aien-app-1.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/aien-app-1.git'

Does anyone know how to solve it?I beg for help有谁知道如何解决它?我请求帮助

It looks like your code does not compile for some reason.看起来您的代码由于某种原因无法编译。 That may be due to the git branch you are on.这可能是由于您所在的 git 分支所致。 Have you tried the suggested:您是否尝试过建议的:

git push heroku <branchname>:main

It appears you're pushing to the wrong branch since Heroku now deploys from the main branch by default.看来你推错了分支,因为 Heroku 现在默认从主分支部署。 First run第一次运行

git branch

to see what branch you're on.看看你在哪个分支。 For example, if it shows an asterisk next to master, then run例如,如果它在 master 旁边显示一个星号,则运行

git push heroku master:main

or if it says main,或者如果它说主要,

git push heroku main:main # or "git push heroku main"

More information can be seen at the link in your command's output ( here )更多信息可以在您的命令的 output 中的链接中看到( 这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM