我有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
我正在使用:
Java 10
Spring 季启动
Gradle 4
我已经通过heroku应用程序设置添加了heroku / gradle构建包 .
build.gradle
plugins {id'java'id'idea'id'maven'id'war'id'application'id'org.springframework.boot'version'2.0.6.RELEASE'}
mainClassName =“com.my.app.BootApplication”
war {baseName ='my-app'version ='1.0.0'}
logger.lifecycle“war.archivePath = $ war.archivePath”
description =“”“我的应用说明”“”
sourceCompatibility = 10 targetCompatibility = 10
tasks.withType(JavaCompile)
存储库{
maven {url“http://repo.maven.apache.org/maven2”} maven {url uri('../my-locally-private-repository')}}
依赖项{compile group:'org.springframework.boot',name:'spring-boot-starter-data-jpa',version:'2.0.4.RELEASE'compiler group:'org.springframework.boot',name:' 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'compile'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 group:'org.springframework.boot',name:'spring-boot-starter-test',version:'2.0.4.RELEASE'}
system.properties
java.runtime.version = 10
Procfile
web:java -jar build / server / webapp-runner-.jar build / libs / .war
我怎么解决这个问题?