【发布时间】:2016-09-29 17:20:58
【问题描述】:
我正在部署到 Heroku,我还没有真正改变任何东西,现在 Heroku 没有创建 Jar。
Gradle buildpack 仍处于“测试版”,尽管它从未让我失望。
Heroku
remote: -----> Using set buildpack heroku/gradle
remote: -----> Gradle app detected
remote: -----> Installing OpenJDK 1.8... done
remote: -----> Installing Gradle Wrapper...
remote: WARNING: Your application does not have it's own gradlew file.
remote: We'll install one for you, but this is a deprecated feature and
remote: in the future may not be supported.
remote: -----> Building Gradle app...
remote: WARNING: The Gradle buildpack is currently in Beta.
remote: -----> executing ./gradlew stage
remote: :api:compileJavaNote: Some input files use unchecked or unsafe operations.
remote: Note: Recompile with -Xlint:unchecked for details.
remote:
remote: :api:processResources
remote: :api:classes
remote: :api:war
remote: :api:bootRepackage
remote: :api:assemble
remote: :api:cleanNode
remote: :api:stage
remote: BUILD SUCCESSFUL
请注意缺少:api:jar,但在本地它就在那里..
:api:compileJava UP-TO-DATE
:api:processResources UP-TO-DATE
:api:classes UP-TO-DATE
:api:jar
:api:findMainClass
:api:startScripts
:api:distTar
:api:distZip
:api:war
:api:bootRepackage
:api:assemble
:api:cleanNode
:api:stage
BUILD SUCCESSFUL
Gradle 是直截了当的。
apply plugin: "java"
apply plugin: "war"
apply plugin: "spring-boot"
task cleanNode {
doLast {
// clean up files we no longer need in the slug
delete '../node_modules'
delete '../html/bower_components'
}
}
// used by Heroku
task stage {
dependsOn cleanNode, assemble
}
【问题讨论】:
-
您能检查一下您的
build.gradle是否已签入Git 吗?然后你能通过运行git push heroku HEAD:master来检查你推送的分支是否正确吗? -
这是百分百正确的。
-
这是否意味着文件已签入并且您正在部署正确的分支,但您仍然遇到问题?
-
对,抱歉没有澄清。我
run bash,catbuild.gradle。一切看起来都很好。我想知道我是否必须使用包装器。 -
明智的做法是使用包装器。它将确保您在本地和 Heroku 上运行相同版本的 Gradle。
标签: java spring heroku gradle spring-boot