作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
请帮助在 Heroku 上部署我的应用程序。从 Heroku 获取错误消息 *
"Application Error. An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details."
这里是来自 Heroku 的日志:
2016-07-21T22:11:30.966800+00:00 heroku[slug-compiler]: Slug compilation
started 2016-07-21T22:11:30.773385+00:00 heroku[api]: Release v8 created by
zzheads@gmail.com 2016-07-21T22:11:56.184847+00:00 heroku[router]: at=error
code=H14 desc="No web processes running" method=GET path="/favicon.ico"
host=zzheads-countries.herokuapp.com request_id=a03c9276-b038-4f9f-8e6d-
5f29f14b441 fwd="5.3.141.153" dyno= connect= service= status=503 bytes=
我的 gradle 构建文件:
group 'com.zzheads'
version '1.0-SNAPSHOT'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.6.RELEASE'
}
}
apply plugin: 'java'
apply plugin: 'spring-boot'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
}
task stage {
dependsOn build
}
还有我的 Proc 文件:
web: java -Dserver.port=$PORT $JAVA_OPTS -jar target/countries-1.0-SNAPSHOT.jar
最佳答案
您的构建可能会在目录 build/libs
中生成一个可执行 JAR 文件。在您的 Procfile
中尝试一下:
web: java -Dserver.port=$PORT $JAVA_OPTS -jar build/libs/countries-1.0-SNAPSHOT.jar
您可以通过运行以下命令在本地测试它:
$ ./gradlew stage
$ heroku local
关于java - 如何在 Heroku 上部署 java gradle 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38515588/
我是一名优秀的程序员,十分优秀!