簡體   English   中英

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

[英]Deploy Spring Boot with Gradle (Kotlin) application - the jar is not found

我有一個使用Spring Boot,Kotlin,Gradle制作的簡單應用程序。 我遵循了官方教程,並嘗試遵循所有可能的默認設置。

$ 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)。 如果您可以將應用程序發布到某處,則可能有助於檢查問題所在。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM