what is the official way of building fat jars with...
# gradle
j
what is the official way of building fat jars with Gradle 5+? The docs says one should do this:
Copy code
tasks.register<Jar>("uberJar") {
	archiveClassifier.set("uber")

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

	dependsOn(configurations.runtimeClasspath)
	from({
		configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
	})
}
but i'm not seeing a fat jar in build/libs when doing
gradle build
` https://docs.gradle.org/current/userguide/working_with_files.html#sec:creating_uber_jar_example
g
I wouldn’t use this sample and instead use shadowjar plugin
j
does the shadow jar plugin do it differently ?
g
It's just more integrated solution (supports jar, application plugin, publishing), has additional features like include/exclude dependencies, repack, has proper up-to-date checks and do not require any imperative code in your build config, just apply plugin, run task
👍 1