From 867e8ef3bec6dee4c4f77e591f64fbc3cf8b77ad Mon Sep 17 00:00:00 2001 From: mkuligowski Date: Sun, 3 Dec 2017 11:23:53 +0100 Subject: [PATCH] Add custom task which produces fat jar --- gradle/gradle-fat-jar/build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gradle/gradle-fat-jar/build.gradle b/gradle/gradle-fat-jar/build.gradle index 334583d486..23d66943cb 100644 --- a/gradle/gradle-fat-jar/build.gradle +++ b/gradle/gradle-fat-jar/build.gradle @@ -14,6 +14,17 @@ jar { } } + +task customFatJar(type: Jar) { + manifest { + attributes 'Main-Class': 'com.baeldung.fatjar.Application' + } + baseName = 'all-in-one-jar' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + + dependencies{ compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'