diff --git a/.github/workflows/pre-release-tests.yml b/.github/workflows/pre-release-tests.yml index 6375d9c8..5c7dc986 100644 --- a/.github/workflows/pre-release-tests.yml +++ b/.github/workflows/pre-release-tests.yml @@ -17,8 +17,8 @@ jobs: - name: Set up Java uses: actions/setup-java@v5 with: - java-version: 8 - distribution: 'zulu' + java-version: 17 + distribution: 'temurin' cache: gradle - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7bb6970b..e5eda1ce 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,8 +21,8 @@ jobs: - name: Set up Java uses: actions/setup-java@v5 with: - java-version: 8 - distribution: 'zulu' + java-version: 17 + distribution: 'temurin' cache: gradle - name: Grant execute permission for gradlew run: chmod +x gradlew @@ -46,11 +46,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - name: Set up JDK 1.8 + - name: Set up JDK 17 uses: actions/setup-java@v5 with: - java-version: 8 - distribution: 'zulu' + java-version: 17 + distribution: 'temurin' - name: Run linter run: bash scripts/lint.sh - name: Yaml lint check diff --git a/README.md b/README.md index 6a412b57..0451dd28 100644 --- a/README.md +++ b/README.md @@ -295,7 +295,7 @@ This SDK is compatible with the following JDK versions: | SDK Version | Supported Java Versions | |-------------|-------------------------| -| v1.x | JDK 8 and above | +| v1.x | JDK 17 and above | ## 💡 Learn more diff --git a/build.gradle b/build.gradle index 4015aa0a..9c5ed704 100644 --- a/build.gradle +++ b/build.gradle @@ -13,13 +13,16 @@ plugins { id 'signing' id 'jacoco' id "io.github.gradle-nexus.publish-plugin" version "2.0.0" - id "com.diffplug.spotless" version "6.13.0" + id "com.diffplug.spotless" version "6.25.0" } group = 'com.meilisearch.sdk' -archivesBaseName = 'meilisearch-java' version = '0.15.0' +base { + archivesName.set('meilisearch-java') +} + jacoco { toolVersion = "0.8.8" reportsDirectory = layout.buildDirectory.dir("$projectDir/tmp/coverage") @@ -117,8 +120,8 @@ task integrationTest(type: Test) { } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 withJavadocJar() withSourcesJar() @@ -193,7 +196,7 @@ spotless { // don't need to set target, it is inferred from java // apply a specific flavor of google-java-format - googleJavaFormat('1.7').aosp() + googleJavaFormat('1.10.0').aosp() } } diff --git a/docker-compose.yml b/docker-compose.yml index ee3829e1..d7d64ac5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: package: - image: azul/zulu-openjdk:11-latest + image: azul/zulu-openjdk:17-latest tty: true stdin_open: true working_dir: /home/package diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 942039f2..35a1b01f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/test/java/com/meilisearch/integration/ClientTest.java b/src/test/java/com/meilisearch/integration/ClientTest.java index 82cb4656..52d5e97a 100644 --- a/src/test/java/com/meilisearch/integration/ClientTest.java +++ b/src/test/java/com/meilisearch/integration/ClientTest.java @@ -12,6 +12,7 @@ import com.meilisearch.sdk.exceptions.MeilisearchException; import com.meilisearch.sdk.model.*; import com.meilisearch.sdk.utils.Movie; +import java.lang.reflect.InaccessibleObjectException; import java.lang.reflect.Modifier; import org.junit.jupiter.api.*; @@ -320,8 +321,8 @@ public void testTransientFieldExclusion() throws MeilisearchException { Gson gsonWithTransient = new GsonBuilder().excludeFieldsWithModifiers(Modifier.STATIC).create(); - // TODO: Throws StackOverflowError on JDK 1.8, but InaccessibleObjectException on JDK9+ - Assertions.assertThrows(StackOverflowError.class, () -> gsonWithTransient.toJson(test)); + Assertions.assertThrows( + InaccessibleObjectException.class, () -> gsonWithTransient.toJson(test)); Assertions.assertDoesNotThrow(() -> gson.toJson(test)); } }