Skip to content

Commit

Permalink
switch to gradle 8.5 and Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkuhn committed Jan 2, 2024
1 parent ba23167 commit 61a45a9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Set up JDK 17 (temurin)
- name: Set up Eclipse Temurin JDK
uses: actions/setup-java@v3
with:
# setup-java v2 supports temurin + zulu distros, see https://github.com/actions/setup-java
# setup-java v2 supports temurin + various other distributions
# see https://github.com/actions/setup-java?tab=readme-ov-file#supported-version-syntax
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Configure AWS Credentials
# avoid https://github.com/aws-actions/configure-aws-credentials#notice-node12-deprecation-warning
uses: aws-actions/configure-aws-credentials@v3.0.1
uses: aws-actions/configure-aws-credentials@v3
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # run only on main
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -53,7 +54,7 @@ jobs:
# https://docs.github.com/en/actions/language-and-framework-guides/building-and-testing-java-with-gradle#caching-dependencies
# https://docs.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows
- name: Cache Gradle packages
uses: actions/cache@v3.3.2
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle.kts') }}
Expand All @@ -62,7 +63,7 @@ jobs:
# Cache Gradle Wrapper separately
# Inspired by: https://github.com/JetBrains/intellij-platform-plugin-template/actions/runs/242898088/workflow
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3.3.2
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
Expand Down
15 changes: 8 additions & 7 deletions docs/modules/ROOT/pages/devops/update.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ Generated report file build/dependencyUpdates/report.txt

=== Upgrade Gradle

TIP: Use sdkman to manage gradle versions
TIP: Use sdkman to manage gradle versions, make sure Gradle an JVM Versions match according to the
https://docs.gradle.org/current/userguide/compatibility.html[Compatibility Matrix]

----
sdk list gradle
Expand All @@ -114,22 +115,22 @@ lrwxr-xr-x 1 tillkuhn staff 5 24 Apr 09:25 current@ -> 6.7.1
.update wrapper props, see also https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper[Upgrading the Gradle Wrapper]
----
$ grep Url gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
$ ./gradlew wrapper --gradle-version 7.2
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
$ ./gradlew wrapper --gradle-version 8.5
----

And Make sure intellij setup matches

* IntelliJ -> Preferences -> Build Tools -> Gradle -> Specified Location -> use the 7.2 Path
* IntelliJ -> Preferences -> Build Tools -> Gradle -> Specified Location -> use the 8.5 Path
* Make sure Gradle JVM is the same as File -> Project Structure -> Project SDK

=== API Dockerfile

Check JRE / JDCK version in `api/Dockerfile` and compare with recent versions on https://hub.docker.com/r/adoptopenjdk/openjdk14[dockerhub] (or check for later major versions since it's already 2021)
Check JRE / JDK version in `api/Dockerfile` and compare with recent versions on https://hub.docker.com/_/eclipse-temurin/tags?page=1&name=21[dockerhub] (or check for later major versions since it's already 2024)

----
ARG FROM_TAG=aarch64-ubuntu-jre-16.0.1_9
FROM adoptopenjdk/openjdk14:$FROM_TAG
ARG FROM_TAG=21-jre
FROM eclipse-temurin:$FROM_TAG
----

== Upgrade Go Tools
Expand Down
2 changes: 1 addition & 1 deletion kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ tasks.bootJar {
}

jacoco {
toolVersion = "0.8.7"
toolVersion = "0.8.11"
}

// Configure which reports are generated by Jacococ coverage tool
Expand Down
5 changes: 3 additions & 2 deletions kotlin/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
# versions is used to declare the version numbers that will be referenced later by plugins and libraries.
[versions]
# Define version we can use as version.ref in [plugins] and [libraries], see flyway-core example below
# CAUTION: 9.22.3 leads to Caused by: java.lang.IllegalArgumentException: Unsupported class file major v 63 (Java 19)
flyway = "9.21.1"
# CAUTION: 9.22.3 causes "Unsupported class file major v 63 (Java 19)" with Java 17
# 10.4.1 newest causes java.lang.NoSuchMethodError at FlywayAutoConfiguration.java:254
flyway = "9.22.3"
postgresql="42.7.1"

# plugins Were added in Gradle 7.2, are used (obviouly) to define plugins.
Expand Down
4 changes: 3 additions & 1 deletion kotlin/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ distributionPath=wrapper/dists
# keep the version consistent with you local gradle version managed by sdkman, and the version used by IntelliJ
# if you don't use the wrapper version for local development
# check https://services.gradle.org/distributions/ for new versions
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
# check https://docs.gradle.org/current/userguide/compatibility.html for compatibility matrix with JDK versions
#distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 61a45a9

Please sign in to comment.