Created
June 15, 2021 12:09
-
-
Save torgeir/fd257ce8c4462cf496877c60fc3195ed to your computer and use it in GitHub Desktop.
Gradle no plugin solution for building fat jars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val fatJar = task<Jar>("fatJar") { | |
with(tasks["jar"] as CopySpec) | |
duplicatesStrategy = DuplicatesStrategy.INCLUDE | |
from(configurations.runtimeClasspath.get().map { | |
if (it.isDirectory) it | |
else zipTree(it) | |
}) | |
manifest { | |
attributes["Main-Class"] = "io.ktor.server.netty.EngineMain" | |
} | |
} | |
tasks.getByName("build") | |
.dependsOn(fatJar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/41794914/how-to-create-the-fat-jar-with-gradle-kotlin-script