I have java project with gradle and spring boot that I want to deploy to Heroku.
I created myApp.war locally using gradle war
(I have to deploy locally because I'm using a local lib repository). The war have been created with success, but when I tried to deploy to Heroku heroku war:deploy myApp.war --app appName
, I received the error:
! 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
I'm using:
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 = """My app description"""
sourceCompatibility = 10 targetCompatibility = 10
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
repositories {
maven { url "http://repo.maven.apache.org/maven2" }
maven { url uri('../my-locally-private-repository') }
}
dependencies { compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version:'2.0.4.RELEASE' compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version:'2.0.4.RELEASE' compile group: 'org.springframework.boot', name: 'spring-boot-starter-web-services', version:'2.0.4.RELEASE' compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version:'2.0.4.RELEASE' compile 'com.github.jsimone:webapp-runner:8.5.11.3' compile group: 'org.hamcrest', name: 'hamcrest-core', version:'1.3' compile group: 'com.my.app, name: 'private-dependency-1', version:'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
How can I solve this problem?
Run heroku buildpacks:clear
like the error message says. The heroku/gradle buildpack is not used when you push a WAR file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With