I'm trying to build a Spring Boot application in Heroku, but apparently, they can't find the JAR file
2018-02-22T14:54:06.434832+00:00 heroku[web.1]: Process exited with status 1
2018-02-22T14:54:06.350652+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2018-02-22T14:54:06.359456+00:00 app[web.1]: Error: Unable to access jarfile build/libs/algamoney*.jar
2018-02-22T14:54:06.667596+00:00 heroku[web.1]: State changed from starting to crashed
I created profile:
web: java -Dserver.port=$PORT -Dspring.profiles.active=prod $JAVA_OPTS -jar build/libs/algamoney*.jar
I've found some similar questions here in Stack overflow and the solution is put some tasks in the build.gradle
file, but it still doesn't work. Here is my build.gradle
file:
buildscript {
ext {
springBootVersion = '1.5.10.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
group = 'com.algaworks.algamoney-api'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-security')
compile "org.springframework.boot:spring-boot-configuration-processor"
compile('org.springframework.security.oauth:spring-security-oauth2')
compile('org.springframework.security:spring-security-jwt')
compile('mysql:mysql-connector-java')
compile('org.flywaydb:flyway-core')
compile('org.hibernate:hibernate-java8')
compile('com.fasterxml.jackson.datatype:jackson-datatype-jsr310')
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
runtime('org.springframework.boot:spring-boot-devtools')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
I've looked for a lot of possible solutions, even in the heroku documentation, but I still not find any solution which could solve my problem.