fat-jar

Fat jar means, that code of project and code of all dependencies will be included in the resulting jar. For example, if you write on Kotlin, jar will contain Kotlin SDK.


tasks.register<Jar>("fatJar") {
    archiveClassifier.set("fat")

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

    dependsOn(configurations.runtimeClasspath)
    from({
        configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
    })
}