@@ -17,17 +17,36 @@ ext {
1717
1818ext. versions = [
1919 " gson" : " 2.7" ,
20- " jackson" : " 2.10.0"
20+ " jacksonCore" : " 2.10.5" ,
21+ " jacksonDatabind" : " 2.10.5.1"
2122]
2223
2324ext. libraries = [:]
2425
26+ configurations {
27+ privateImplementation
28+ }
29+
2530dependencies {
26- // Dependencies will not be exposed in the pom - see below in pom.withXml block
27- implementation " com.google.code.gson:gson:${ versions.gson} "
28- implementation " com.fasterxml.jackson.core:jackson-core:${ versions.jackson} "
29- implementation " com.fasterxml.jackson.core:jackson-databind:${ versions.jackson} "
31+ // The Gson and Jackson dependencies go into a custom configuration here, instead of
32+ // the regular "implementation" configuration. We don't want them to be visible at
33+ // all in the module's published dependencies - not even in "runtime" scope - because:
34+ //
35+ // 1. For Gson: While java-sdk-common does need Gson in order to work, the
36+ // LaunchDarkly SDKs that use java-sdk-common have different strategies for packaging
37+ // Gson. The Android SDK exposes it as a regular dependency; the Java server-side SDK
38+ // embeds and shades Gson and does not expose it as a dependency. So we are leaving
39+ // it up to the SDK to provide Gson in some way.
40+ //
41+ // 2. For Jackson: The SDKs do not use, require, or embed Jackson; we provide the
42+ // LDJackson class as a convenience for applications that do use Jackson, and it is
43+ // only usable if the application already has Jackson in its classpath. So we do not
44+ // want Jackson to show up as a transitive dependency.
45+ privateImplementation " com.google.code.gson:gson:${ versions.gson} "
46+ privateImplementation " com.fasterxml.jackson.core:jackson-core:${ versions.jacksonCore} "
47+ privateImplementation " com.fasterxml.jackson.core:jackson-databind:${ versions.jacksonDatabind} "
3048
49+ testImplementation configurations. privateImplementation
3150 testImplementation " org.hamcrest:hamcrest-library:1.3"
3251 testImplementation " junit:junit:4.12"
3352}
0 commit comments