Skip to content

Commit a8475f6

Browse files
authored
Provide shaded jar with dgraph4j's dependencies (#239)
Using the Dgraph4j client in an application that is bound to its own Netty dependency version like Apache Spark creates conflicts that can only be resolved by shading Dgraph4j's dependencies. This releases the shaded jar together with other artifacts.
1 parent d3eac18 commit a8475f6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
18+
1719
buildscript {
1820
repositories {
1921
maven {
@@ -32,6 +34,7 @@ plugins {
3234
id 'com.github.sherter.google-java-format' version '0.9'
3335
id 'base'
3436
id 'maven-publish'
37+
id 'com.gradleup.shadow' version '8.3.2'
3538
}
3639
// Apply the java plugin to add support for Java
3740
apply plugin: 'java'
@@ -171,6 +174,14 @@ task fatJar(type: Jar) {
171174
with jar
172175
}
173176

177+
tasks.named('shadowJar', ShadowJar) {
178+
enableRelocation true
179+
relocationPrefix "io.dgraph.dgraph4j.shaded"
180+
relocate 'google', 'io.dgraph.dgraph4j.shaded.google'
181+
archiveClassifier.set("shaded")
182+
mergeServiceFiles()
183+
}
184+
174185
task buildJar(type: Jar)
175186

176187
task javadocJar(type: Jar) {
@@ -201,6 +212,7 @@ task integrationTest(type: Test) {
201212

202213
artifacts {
203214
archives jar
215+
archives shadowJar
204216
archives sourceJar
205217
archives javadocJar
206218
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)