How can I rename the produced jar by the gradle scala plugin using gradle build
task to include the scala version name? I believe this property is called: archivesBaseName
. It is made available from the java plugin (https://docs.gradle.org/current/dsl/org.gradle.api.Project.html#org.gradle.api.Project:archivesBaseName).
NOTE: I would want to accomplish this task using the kotlin DSL.
For the shadow jar:
id("com.github.johnrengelman.shadow") version "5.2.0" apply false
val shadowJar: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar by tasks
shadowJar.apply {
archiveBaseName.set("${project.name}_2.12-all")
}
tasks {
build {
dependsOn(shadowJar)
}
already works fine, but I would want to change the regular output as well.
I.e.:
archivesBaseName = "asdf"//"${project.name}_${sparkVersion}_${scalaVersionShort}"
usually works. But I have not figured out how to get this to work in the Kotlin DSL
base.archivesBaseName = "gradle"
gets the job done