From 8aa8e3892d338d92565cec5d2410a912ade724f8 Mon Sep 17 00:00:00 2001 From: Doug Gish Date: Fri, 13 Dec 2024 20:56:52 -0700 Subject: [PATCH] Depend on jackson-jakarta-rs-json-provider when useJakartaEe is true (#20322) In the build.gradle template for the Java generator's resttemplate library, change dependency to com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider instead of com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider when useJarkartaEe is enabled. This makes it consistent with the pom template file. --- .../Java/libraries/resttemplate/build.gradle.mustache | 5 +++++ .../client/petstore/java/resttemplate-jakarta/build.gradle | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index 58706c9abc9c..edd170cd392c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -147,7 +147,12 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + {{^useJakartaEe}} implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + {{/useJakartaEe}} + {{#useJakartaEe}} + implementation "com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider:$jackson_version" + {{/useJakartaEe}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} diff --git a/samples/client/petstore/java/resttemplate-jakarta/build.gradle b/samples/client/petstore/java/resttemplate-jakarta/build.gradle index 5cb604aa3ad0..b4530c64a7fa 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/build.gradle +++ b/samples/client/petstore/java/resttemplate-jakarta/build.gradle @@ -114,7 +114,7 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" - implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + implementation "com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"