java-tutorials/gradle/gradle-fat-jar/build.gradle

41 lines
864 B
Groovy
Raw Normal View History

2017-12-03 05:26:27 -05:00
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
}
}
2017-12-02 17:30:28 -05:00
apply plugin: 'java'
2017-12-03 05:26:27 -05:00
apply plugin: 'com.github.johnrengelman.shadow'
2017-12-02 17:30:28 -05:00
repositories {
mavenCentral()
}
jar {
manifest {
attributes "Main-Class": "com.baeldung.fatjar.Application"
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
2017-12-03 05:23:53 -05:00
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
}
2017-12-02 17:30:28 -05:00
dependencies{
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
}