From 4c934445708ef7ae939c54fd3ca234e3841b4542 Mon Sep 17 00:00:00 2001 From: Axel Howind Date: Tue, 5 Nov 2024 16:01:25 +0100 Subject: [PATCH] restore Java 11 compatibility --- .github/workflows/build-jlink-plugin.yml | 8 ++++---- .github/workflows/publish-plugin.yml | 4 ++-- build.gradle | 2 +- doc/introduction.adoc | 2 +- src/test/groovy/org/beryx/jlink/JavaVersionSpec.groovy | 2 +- src/test/resources/hello-bom/build.gradle | 4 ++-- .../resources/hello-log4j-2.19.0/build.additive.gradle | 4 ++-- .../hello-log4j-2.19.0/build.additive.gradle.kts | 4 ++-- src/test/resources/hello-log4j-2.19.0/build.gradle | 4 ++-- src/test/resources/local-deps/build.gradle | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-jlink-plugin.yml b/.github/workflows/build-jlink-plugin.yml index f2250a64..2de04a52 100644 --- a/.github/workflows/build-jlink-plugin.yml +++ b/.github/workflows/build-jlink-plugin.yml @@ -12,10 +12,10 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 11 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '11' distribution: 'zulu' - name: Gradle build uses: gradle/gradle-build-action@v3 @@ -37,10 +37,10 @@ jobs: if: "startsWith(github.event.head_commit.message, 'Release ')" steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 11 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '11' distribution: 'zulu' - name: Publish Gradle Plugins uses: gradle/gradle-build-action@v3 diff --git a/.github/workflows/publish-plugin.yml b/.github/workflows/publish-plugin.yml index eef1cb4e..91badfb1 100644 --- a/.github/workflows/publish-plugin.yml +++ b/.github/workflows/publish-plugin.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 11 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '11' distribution: 'zulu' - name: Publish Gradle Plugins uses: gradle/gradle-build-action@v3 diff --git a/build.gradle b/build.gradle index 034cdc9c..5776e556 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ plugins { id 'org.ajoberstar.git-publish' version '4.2.2' } -java.toolchain.languageVersion = JavaLanguageVersion.of(17) +java.toolchain.languageVersion = JavaLanguageVersion.of(11) project.version.with { major = pluginVersionMajor as int diff --git a/doc/introduction.adoc b/doc/introduction.adoc index d0871af1..c3940045 100644 --- a/doc/introduction.adoc +++ b/doc/introduction.adoc @@ -18,7 +18,7 @@ The plugin provides several tasks. The most frequently used are `jlink`, which c and `jlinkZip`, which in addition creates a zip archive of the custom runtime image. With the `jpackage` task you can create a platform-specific installer for your application. -WARNING: The current version of this plugin requires Java 17 and Gradle 7.4 or newer. +WARNING: The current version of this plugin requires Java 11 and Gradle 7.4 or newer. While it might work with some combinations of older Java and Gradle versions, these are not officially supported. If you are forced to work with an older Gradle release, you should use https://badass-jlink-plugin.beryx.org/releases/2.25.0/[the version 2.25.0] of this plugin. diff --git a/src/test/groovy/org/beryx/jlink/JavaVersionSpec.groovy b/src/test/groovy/org/beryx/jlink/JavaVersionSpec.groovy index af05fdef..e2db3d87 100644 --- a/src/test/groovy/org/beryx/jlink/JavaVersionSpec.groovy +++ b/src/test/groovy/org/beryx/jlink/JavaVersionSpec.groovy @@ -26,6 +26,6 @@ class JavaVersionSpec extends Specification { int version = JavaVersion.get(System.getenv('JAVA_HOME')) then: - version == 17 + version == 11 } } diff --git a/src/test/resources/hello-bom/build.gradle b/src/test/resources/hello-bom/build.gradle index cfa6ac3a..e888daf1 100644 --- a/src/test/resources/hello-bom/build.gradle +++ b/src/test/resources/hello-bom/build.gradle @@ -7,8 +7,8 @@ repositories { mavenCentral() } -sourceCompatibility = 17 -targetCompatibility = 17 +sourceCompatibility = 11 +targetCompatibility = 11 dependencies { // import a BOM diff --git a/src/test/resources/hello-log4j-2.19.0/build.additive.gradle b/src/test/resources/hello-log4j-2.19.0/build.additive.gradle index 79018c06..ef137b75 100644 --- a/src/test/resources/hello-log4j-2.19.0/build.additive.gradle +++ b/src/test/resources/hello-log4j-2.19.0/build.additive.gradle @@ -6,8 +6,8 @@ repositories { mavenCentral() } -sourceCompatibility = 17 -targetCompatibility = 17 +sourceCompatibility = 11 +targetCompatibility = 11 ext.log4jVersion = '2.19.0' diff --git a/src/test/resources/hello-log4j-2.19.0/build.additive.gradle.kts b/src/test/resources/hello-log4j-2.19.0/build.additive.gradle.kts index 142853dd..40d5c4a8 100644 --- a/src/test/resources/hello-log4j-2.19.0/build.additive.gradle.kts +++ b/src/test/resources/hello-log4j-2.19.0/build.additive.gradle.kts @@ -7,8 +7,8 @@ repositories { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } val log4jVersion = "2.19.0" diff --git a/src/test/resources/hello-log4j-2.19.0/build.gradle b/src/test/resources/hello-log4j-2.19.0/build.gradle index bc239d17..0f8cd3dc 100644 --- a/src/test/resources/hello-log4j-2.19.0/build.gradle +++ b/src/test/resources/hello-log4j-2.19.0/build.gradle @@ -6,8 +6,8 @@ repositories { mavenCentral() } -sourceCompatibility = 17 -targetCompatibility = 17 +sourceCompatibility = 11 +targetCompatibility = 11 ext.log4jVersion = '2.19.0' diff --git a/src/test/resources/local-deps/build.gradle b/src/test/resources/local-deps/build.gradle index f3ed3472..7a64ba5d 100644 --- a/src/test/resources/local-deps/build.gradle +++ b/src/test/resources/local-deps/build.gradle @@ -6,7 +6,7 @@ plugins { group 'org.example' version '1.0' -sourceCompatibility = 17 +sourceCompatibility = 11 application { mainClass = "org.example.Hello"