Merge pull request #12347 from hkhan/JAVA-9046-fix-gradle-fat-jar-build
[JAVA-9046] Fix build for Gradle 7.x
This commit is contained in:
commit
145ca36218
|
@ -3,7 +3,7 @@ buildscript {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
|
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ jar {
|
||||||
}
|
}
|
||||||
|
|
||||||
from {
|
from {
|
||||||
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
|
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,12 +30,13 @@ task customFatJar(type: Jar) {
|
||||||
attributes 'Main-Class': 'com.baeldung.fatjar.Application'
|
attributes 'Main-Class': 'com.baeldung.fatjar.Application'
|
||||||
}
|
}
|
||||||
baseName = 'all-in-one-jar'
|
baseName = 'all-in-one-jar'
|
||||||
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||||
with jar
|
with jar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
|
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
|
||||||
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
|
implementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
|
||||||
}
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
rootProject.name = 'gradle-fat-jar'
|
Loading…
Reference in New Issue