我有一个带有gradle和spring boot的Java项目,我想将其部署到Heroku。
我使用gradle war
在本地创建了myApp.war(我必须在本地部署,因为我正在使用本地lib存储库)。这场战争已经成功创建,但是当我尝试部署到Heroku heroku war:deploy myApp.war --app appName
时,我收到了错误消息:
! ERROR: Your buildpacks do not contain the heroku/jvm buildpack!Add heroku/jvm to your buildpack configuration or run `heroku buildpacks:clear`.
! Re-run with HEROKU_DEBUG=1 for more info.
! There was a problem deploying to appName.
! Make sure you have permission to deploy by running: heroku apps:info -a appName
我正在使用:
build.gradle
插件{ id'java' id'idea' id'maven' id'战争' id“应用程序” id'org.springframework.boot'版本'2.0.6.RELEASE' }
mainClassName =“ com.my.app.BootApplication”
战争{ baseName ='我的应用程序' 版本='1.0.0' }
logger.lifecycle“ war.archivePath = $ war.archivePath”
description =“”“我的应用程序描述”“”
sourceCompatibility = 10 targetCompatibility = 10
tasks.withType(JavaCompile){ options.encoding ='UTF-8' }
存储库{
专家{url“ http://repo.maven.apache.org/maven2”}
maven {url uri('../ my-locally-private-repository')}
}
依赖项{ 编译组:“ org.springframework.boot”,名称:“ spring-boot-starter-data-jpa”,版本:“ 2.0.4.RELEASE” 编译组:“ org.springframework.boot”,名称:“ spring-boot-starter-web”,版本:“ 2.0.4.RELEASE” 编译组:“ org.springframework.boot”,名称:“ spring-boot-starter-web-services”,版本:“ 2.0.4.RELEASE” 编译组:“ org.springframework.boot”,名称:“ spring-boot-starter-security”,版本:“ 2.0.4.RELEASE” 编译'com.github.jsimone:webapp-runner:8.5.11.3' 编译组:“ org.hamcrest”,名称:“ hamcrest-core”,版本:“ 1.3” 编译组:“ com.my.app”,名称:“ private-dependency-1”,版本:“ 1.0.0” testCompile组:“ org.springframework.boot”,名称:“ spring-boot-starter-test”,版本:“ 2.0.4.RELEASE” }
system.properties
java.runtime.version = 10
Procfile
网络:java -jar build / server / webapp-runner- .jar build / libs / .war
我该如何解决这个问题?
答案 0 :(得分:2)
按照错误消息所述运行heroku buildpacks:clear
。推送WAR文件时,不会使用heroku / gradle buildpack。