Skip to content

Commit

Permalink
[JAVA-9046] Fix build for Gradle 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
hkhan committed Jun 13, 2022
1 parent 36f3fde commit 7f736c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions gradle/gradle-fat-jar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
}
}

Expand All @@ -20,7 +20,7 @@ jar {
}

from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}

Expand All @@ -30,12 +30,13 @@ task customFatJar(type: Jar) {
attributes 'Main-Class': 'com.baeldung.fatjar.Application'
}
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
}


dependencies{
compile 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-api', version: '1.7.25'
implementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
}
1 change: 1 addition & 0 deletions gradle/gradle-fat-jar/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'gradle-fat-jar'

0 comments on commit 7f736c2

Please sign in to comment.