Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public JavaClientCodegen() {
cliOptions.add(CliOption.newBoolean(USE_JSPECIFY, "Use Jspecify for null checks. Only supported for " + JSPECIFY_SUPPORTED_LIBRARIES, useJspecify));

supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.17.1");
supportedLibraries.put(JERSEY3, "HTTP client: Jersey client 3.1.1. JSON processing: Jackson 2.17.1");
supportedLibraries.put(JERSEY3, "HTTP client: Jersey client 3.1.1. JSON processing: Jackson 2.17.1. Use `useSpringBoot4=true` to align dependency versions (jakarta.annotation 3.0.0, jakarta.validation 3.1.1) and Java target (17) with Spring Boot 4.x.");
supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 13.2.1. JSON processing: Jackson 2.17.1 or Gson 2.10.1");
supportedLibraries.put(FEIGN_HC5, "HTTP client: OpenFeign 13.2.1/HttpClient5 5.4.2. JSON processing: Jackson 2.17.1 or Gson 2.10.1");
supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 25
}
compileOptions {
{{#useSpringBoot4}}
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
Comment on lines +37 to +38
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: useSpringBoot4 forces Java 17 in the Android build path, but this template still uses an old AGP/Gradle toolchain that does not support it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache, line 37:

<comment>`useSpringBoot4` forces Java 17 in the Android build path, but this template still uses an old AGP/Gradle toolchain that does not support it.</comment>

<file context>
@@ -33,8 +33,14 @@ if(hasProperty('target') && target == 'android') {
         }
         compileOptions {
+            {{#useSpringBoot4}}
+            sourceCompatibility JavaVersion.VERSION_17
+            targetCompatibility JavaVersion.VERSION_17
+            {{/useSpringBoot4}}
</file context>
Suggested change
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8

{{/useSpringBoot4}}
{{^useSpringBoot4}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
{{/useSpringBoot4}}
}

// Rename the aar correctly
Expand Down Expand Up @@ -78,8 +84,14 @@ if(hasProperty('target') && target == 'android') {

apply plugin: 'java'
apply plugin: 'maven-publish'
{{#useSpringBoot4}}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
{{/useSpringBoot4}}
{{^useSpringBoot4}}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
{{/useSpringBoot4}}

publishing {
publications {
Expand All @@ -105,9 +117,19 @@ ext {
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.10"
{{/openApiNullable}}
{{#useSpringBoot4}}
jakarta_annotation_version = "3.0.0"
{{/useSpringBoot4}}
{{^useSpringBoot4}}
jakarta_annotation_version = "2.1.0"
{{/useSpringBoot4}}
{{#useBeanValidation}}
{{#useSpringBoot4}}
bean_validation_version = "3.1.1"
{{/useSpringBoot4}}
{{^useSpringBoot4}}
bean_validation_version = "3.0.2"
{{/useSpringBoot4}}
{{/useBeanValidation}}
jersey_version = "3.0.4"
junit_version = "5.8.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,14 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
{{#useSpringBoot4}}
<source>17</source>
<target>17</target>
{{/useSpringBoot4}}
{{^useSpringBoot4}}
<source>1.8</source>
<target>1.8</target>
{{/useSpringBoot4}}
<fork>true</fork>
<meminitial>128m</meminitial>
<maxmem>512m</maxmem>
Expand All @@ -167,7 +173,12 @@
</executions>
<configuration>
<doclint>none</doclint>
{{#useSpringBoot4}}
<source>17</source>
{{/useSpringBoot4}}
{{^useSpringBoot4}}
<source>1.8</source>
{{/useSpringBoot4}}
<tags>
<tag>
<name>http.response.details</name>
Expand Down Expand Up @@ -409,6 +420,11 @@
<jackson-annotations-version>2.21</jackson-annotations-version>
<jackson-databind-version>2.21.1</jackson-databind-version>
<jackson-databind-nullable-version>0.2.10</jackson-databind-nullable-version>
{{#useSpringBoot4}}
<jakarta-annotation-version>3.0.0</jakarta-annotation-version>
<beanvalidation-version>3.1.1</beanvalidation-version>
{{/useSpringBoot4}}
{{^useSpringBoot4}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>
Expand All @@ -417,6 +433,7 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{/useSpringBoot4}}
<junit-version>5.10.0</junit-version>
{{#hasHttpSignatureMethods}}
<http-signature-version>1.8</http-signature-version>
Expand Down
Loading