https://kotlinlang.org logo
#gradle
Title
j

janvladimirmostert

04/10/2019, 6:51 PM
figured it out!
Copy code
tasks.withType<Jar> {
	manifest {
		attributes(
			mapOf(
				"Main-Class" to "com.harakati.Application"
			)
		)
	}

	archiveClassifier.set("uber")

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

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

}
just move everything into the tasks.withType<Jar> and it automatically builds the uber jar