gpt4 book ai didi

java - Heroku - git push/deployment 期间出错,此代码的相同版本已经构建

转载 作者:行者123 更新时间:2023-12-04 11:54:04 25 4
gpt4 key购买 nike

我在将 springboot 应用程序部署到 Heroku 时遇到问题。运行后git push heroku master ,我遇到以下错误:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.350 s
[INFO] Finished at: 2020-12-22T06:33:14Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project audit: Fatal error compiling: invalid target release: 11 -> [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :audit
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: 31199a7acec03a3cb614ebaaf6c7720cee6684bd
remote: !
remote: ! We have detected that you have triggered a build from source code with version 31199a7acec03a3cb614ebaaf6c7720cee6684bd
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 tesda8app.
我不知道为什么会发生这个错误。我有两个远程存储库,用于推送代码,一个来自 Heroku,另一个来自 Github。我根据这个问题的答案尝试了以下命令, Heroku: If you are developing on a branch and deploying via git you must run:
git push heroku master:main
但错误仍然存​​在。我可以在 Heroku CLI 上尝试任何命令来解决这个问题吗?

最佳答案

经过几次尝试,我想问题的原因可能是 中断 git push heroku master命令,然后通过重新执行相同的命令继续执行,导致以下错误:

remote:  !     Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 31199a7acec03a3cb614ebaaf6c7720cee6684bd
remote: !
remote: ! We have detected that you have triggered a build from source code with version 31199a7acec03a3cb614ebaaf6c7720cee6684bd
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
所以我所做的是,我推送了另一个提交,然后重试了相同的命令 git push heroku master ,从而成功部署。
另外,请大喊 RainXCat's answer and insights ,现在我知道 Heroku 不允许在同一目录/文件夹中存在两个 git 存储库。

关于java - Heroku - git push/deployment 期间出错,此代码的相同版本已经构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65404309/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com