【发布时间】:2019-04-02 16:14:17
【问题描述】:
我有想要部署到 Heroku 的带有 gradle 和 spring boot 的 java 项目。
我使用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
- 弹簧靴
- 4 年级
- 我已经通过 heroku 应用设置添加了 heroku/gradle 构建包。
-
build.gradle
插件{ 标识“java” 识别“想法” 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 目标兼容性 = 10
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
存储库{
行家{网址“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' }
-
系统属性
java.runtime.version=10
-
过程文件
web: java -jar build/server/webapp-runner-.jar build/libs/.war
我该如何解决这个问题?
【问题讨论】: