Skip to content

Commit 9ee6841

Browse files
authored
[PBE-5292] Shadow dependencies (#149)
* feat: shadow io.jsonwebtoken library some customers have conflicts for this dependency * feat: include io.jsonwebtoken and jackson in jar also shadow io.jsonwebtoken * feat: publish -all artifact shadowing all the dependencies * fix: request param name file_name -> filename (#150) * fix: update gradle related plugins because gradle was upgraded
1 parent 28eaac0 commit 9ee6841

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

build.gradle

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
plugins {
2-
id 'java'
3-
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
2+
id 'java-library'
3+
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
44
id 'com.diffplug.spotless' version '6.25.0'
5-
id 'org.barfuin.gradle.jacocolog' version '2.0.0'
5+
id 'org.barfuin.gradle.jacocolog' version '3.1.0'
6+
id 'com.github.johnrengelman.shadow' version '8.1.1'
67
}
78

89
group = 'io.getstream'
@@ -13,6 +14,9 @@ java {
1314
toolchain {
1415
languageVersion = JavaLanguageVersion.of(11)
1516
}
17+
18+
withJavadocJar()
19+
withSourcesJar()
1620
}
1721

1822
repositories {
@@ -99,4 +103,10 @@ task generateVersionProperties {
99103
}
100104
processResources.dependsOn generateVersionProperties
101105

106+
shadowJar {
107+
enableRelocation true
108+
relocationPrefix "shadowed"
109+
mergeServiceFiles()
110+
}
111+
102112
apply from: "publish.gradle"

gradle/wrapper/gradle-wrapper.jar

-9 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.

publish.gradle

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,9 @@ nexusPublishing {
3535
}
3636
}
3737

38-
task javadocJar(type: Jar) {
39-
classifier = 'javadoc'
40-
from javadoc
41-
}
42-
43-
task sourcesJar(type: Jar) {
44-
classifier = 'sources'
45-
from sourceSets.main.allSource
46-
}
47-
48-
artifacts {
49-
archives javadocJar, sourcesJar
38+
// to remove shadowed jar from the regular release publication
39+
components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
40+
skip()
5041
}
5142

5243
afterEvaluate {
@@ -56,9 +47,6 @@ afterEvaluate {
5647
from components.java
5748
artifactId 'stream-chat-java'
5849

59-
artifact sourcesJar
60-
artifact javadocJar
61-
6250
pom {
6351
name = "Stream Chat official Java API Client"
6452
description = "Stream Chat Java Client for backend integrations"
@@ -83,6 +71,11 @@ afterEvaluate {
8371
}
8472
}
8573
}
74+
75+
shadow(MavenPublication) { publication ->
76+
project.shadow.component(publication)
77+
artifactId 'stream-chat-java-all'
78+
}
8679
}
8780
}
8881
}

0 commit comments

Comments
 (0)