gpt4 book ai didi

spring-boot - 使用Gradle(Kotlin)应用程序部署Spring Boot-找不到jar

转载 作者:行者123 更新时间:2023-12-03 05:09:58 26 4
gpt4 key购买 nike

我有一个使用Spring Boot,Kotlin,Gradle制作的简单应用程序。我遵循了the official tutorial并尝试遵循所有可能的默认值。

$ git push heroku master
Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 231 bytes | 231.00 KiB/s, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> JVM Common app detected
remote: -----> Installing JDK 1.8... done
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote:
remote: -----> Compressing...
remote: Done: 50.7M
remote: -----> Launching...
remote: Released v50
remote: https://---.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.

我得到“检测到JVM Common应用程序”而不是“检测到Gradle应用程序”,这很奇怪。

我无法部署该应用程序。当我执行 heroku logs --tail时,我得到:
2018-04-02T23:02:39.257887+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -Dserver.port=50478 -jar build/libs/scraper-0.0.1-SNAPSHOT.jar`
2018-04-02T23:02:41.645544+00:00 heroku[web.1]: Process exited with status 1
2018-04-02T23:02:41.664910+00:00 heroku[web.1]: State changed from starting to crashed
2018-04-02T23:02:41.577966+00:00 app[web.1]: Error: Unable to access jarfile build/libs/scraper-0.0.1-SNAPSHOT.jar
2018-04-02T23:02:41.572483+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2018-04-02T23:05:10.000000+00:00 app[api]: Build started by user ---
2018-04-02T23:05:21.108667+00:00 app[api]: Release v50 created by user ---
2018-04-02T23:05:10.000000+00:00 app[api]: Build succeeded
2018-04-02T23:05:21.635834+00:00 heroku[web.1]: State changed from crashed to down
  • 使用Spring Boot 2.0.0.RELEASE
  • 使用Kotlin 1.2.31
  • build.gradle中没有特殊任务
  • 没有Procfile

  • 有什么方法可以使用默认值(即没有Procfile,没有特殊的Gradle任务)来解决此问题?如果无法使用默认值,该怎么办?谢谢

    最佳答案

    您确实应该(至少)获得以下信息:

    remote: -----> Gradle app detected
    remote: -----> Spring Boot detected

    这是您做的第一推吗?您是否手动设置了构建包?也许尝试清除构建包(heroku buildpacks:clear)。如果您可以将应用程序发布到某处,则可能有助于检查问题所在。

    关于spring-boot - 使用Gradle(Kotlin)应用程序部署Spring Boot-找不到jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49620069/

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