Skip to content

Commit

Permalink
🔧 Remove 'shadow' Gradle plugin
Browse files Browse the repository at this point in the history
Because it is not yet compatible with "JavaApplication.setMainClassName removal": GradleUp/shadow#609

Did the fat JAR with the help of the official user guide:
https://docs.gradle.org/current/userguide/building_java_projects.html#sec:java_packaging
  • Loading branch information
nicokosi committed Dec 8, 2020
1 parent ea469f4 commit 819baf6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
id("org.jetbrains.kotlin.jvm") version "1.4.20"
id("se.patrikerdes.use-latest-versions") version "0.2.15"
id("com.github.ben-manes.versions") version "0.36.0"
id("com.github.johnrengelman.shadow") version "6.1.0"
id("com.adarshr.test-logger") version "2.1.1"
id("com.diffplug.spotless") version "5.8.2"
application
Expand Down Expand Up @@ -54,3 +53,14 @@ spotless {
ktlint()
}
}

tasks.register<Jar>("uberJar") {
archiveClassifier.set("all")

from(sourceSets.main.get().output)

dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
2 changes: 1 addition & 1 deletion generate-executable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e

echo "Building JAR file:"
./gradlew shadowJar
./gradlew uberJar
echo "JAR file has been built! ✅"

echo "Install GraalVM via SDKMAN!:"
Expand Down

0 comments on commit 819baf6

Please sign in to comment.