当我尝试git push heroku时出现错误

时间:2020-05-20 07:54:26

标签: java git kotlin gradle heroku

错误即时消息如下,当我执行“ git push heroku master”时会发生这种情况

Enumerating objects: 262, done.
Counting objects: 100% (262/262), done.
Delta compression using up to 4 threads
Compressing objects: 100% (232/232), done.
Writing objects: 100% (262/262), 316.61 KiB | 4.34 MiB/s, done.
Total 262 (delta 34), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Gradle app detected
remote: -----> Installing JDK 1.8... done
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew stage
remote:        Downloading https://services.gradle.org/distributions/gradle-6.0-all.zip
remote:        ......................................................................................................................................
remote:        Unzipping /app/tmp/cache/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0-all.zip to /app/tmp/cache/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd
remote:        Set executable permissions for: /app/tmp/cache/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/bin/gradle
remote:
remote:        > Configure project :
remote:        fatal: not a git repository (or any parent up to mount point /)
remote:        Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
remote:
remote:        FAILURE: Build failed with an exception.
remote:
remote:        * Where:
remote:        Build file '/tmp/build_24a75868b111767bf7a04169c852fe43/build.gradle' line: 102
remote:
remote:        * What went wrong:
remote:        A problem occurred evaluating root project 'XXX-bot'.
remote:        > Process 'command 'git'' finished with non-zero exit value 128
remote:
remote:        * Try:
remote:        Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
remote:
remote:        * Get more help at https://help.gradle.org
remote:
remote:        Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
remote:        Use '--warning-mode all' to show the individual deprecation warnings.
remote:        See https://docs.gradle.org/6.0/userguide/command_line_interface.html#sec:command_line_warnings
remote:
remote:        BUILD FAILED in 51s
remote:
remote:  !     ERROR: Failed to run Gradle!
remote:        We're sorry this build is failing. If you can't find the issue in application
remote:        code, please submit a ticket so we can help: https://help.heroku.com
remote:        You can also try reverting to the previous version of the buildpack by running:
remote:        $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
remote:
remote:        Thanks,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Gradle app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to be-anmusicnew.
remote:
To https://git.heroku.com/XXX
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXX.git'

在执行“ git ls-files gradle”时,列出了以下文件

gradle / wrapper / gradle-wrapper.jar

gradle / wrapper / gradle-wrapper.properties

我的Procfile看起来像这样 “工作者:java -jar target / Bot.jar”

1 个答案:

答案 0 :(得分:1)

在配置项目下存在错误: fatal: not a git repository (or any parent up to mount point /) 所以他不能这样做。 尝试修改您要推送的网址