Skip to content

Commit 867e8ef

Browse files
committed
Add custom task which produces fat jar
1 parent b152de4 commit 867e8ef

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

gradle/gradle-fat-jar/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ jar {
1414
}
1515
}
1616

17+
18+
task customFatJar(type: Jar) {
19+
manifest {
20+
attributes 'Main-Class': 'com.baeldung.fatjar.Application'
21+
}
22+
baseName = 'all-in-one-jar'
23+
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
24+
with jar
25+
}
26+
27+
1728
dependencies{
1829
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
1930
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'

0 commit comments

Comments
 (0)