diff --git a/build.gradle.kts b/build.gradle.kts index 8b2838eb..74285c9a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,8 @@ plugins { id("org.jetbrains.dokka") version "2.1.0" } +val dokkaJacksonVersion = "2.18.9" + repositories { mavenCentral() } @@ -9,6 +11,21 @@ repositories { allprojects { group = "com.openai" version = "4.43.0" // x-release-please-version + + // Dokka 2.1.0 depends on Jackson 2.15.3. Keep its isolated build-tool classpaths on a + // secure, internally aligned Jackson release without changing the SDK's published or + // compatibility-test dependency versions. + configurations.matching { it.name.startsWith("dokka") }.configureEach { + resolutionStrategy.eachDependency { + if ( + requested.group == "com.fasterxml.jackson" || + requested.group.startsWith("com.fasterxml.jackson.") + ) { + useVersion(dokkaJacksonVersion) + because("Dokka's build-only Jackson classpath must use a secure aligned release") + } + } + } } subprojects { diff --git a/openai-java-core/build.gradle.kts b/openai-java-core/build.gradle.kts index b386f1db..9ffa1809 100644 --- a/openai-java-core/build.gradle.kts +++ b/openai-java-core/build.gradle.kts @@ -16,7 +16,9 @@ val jacksonPublishedRuntime by configurations.creating { isCanBeResolved = true } -configurations.matching { it.name != jacksonPublishedRuntime.name }.configureEach { +configurations.matching { + it.name != jacksonPublishedRuntime.name && !it.name.startsWith("dokka") +}.configureEach { resolutionStrategy { // Compile and test against a lower Jackson version to ensure we're compatible with it. Note that // we generally support 2.13.4, but test against 2.14.0 because 2.13.4 has some annoying (but