I have a Kotlin project with JDA API which I need to deploy on Heroku environment. To achieve that I created a JAR task in my build.gradle
file.
jar {
baseName = 'discord-stats-bot'
version = 'v1'
manifest {
attributes('Main-Class': 'com.vchernogorov.discordbot.BotKt')
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
But I was unable to build this JAR file because of the following error.
16:02:03 vchernogorov $ ./gradlew jar
:kaptGenerateStubsKotlin UP-TO-DATE
:kaptKotlin UP-TO-DATE
:compileKotlin UP-TO-DATE
:compileJava UP-TO-DATE
:copyMainKotlinClasses UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:inspectClassesForKotlinIC UP-TO-DATE
:jar
FAILURE: Build failed with an exception.
* What went wrong:
Could not expand ZIP '/Users/vchernogorov/.gradle/caches/modules-2/files-2.1/club.minnced/opus-java/1.0.4/596995aaf2f5b5091c4d251fdc11fa62680cc59e/opus-java-1.0.4.pom'.
> archive is not a ZIP archive
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.784 secs
This library is a dependency in a JDA project. So I need help with configuring this jar
task in order to correctly build my executable and deploy it to Heroku.
Edit: Here's my dependencies
block in build.gradle
.
dependencies {
compile 'com.google.guava:guava:23.0'
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:0.16"
compile "org.jsoup:jsoup:1.10.3"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "net.dv8tion:JDA:3.8.0_436"
compile "khttp:khttp:0.1.0"
compile 'com.google.code.gson:gson:2.8.1'
}