Make Gretty aware of Gradle Java Toolchain (v4.x) #308
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Gretty plugin run containers as a separate java process using the same java that is used by Gradle.
However since Gradle introduced Toolchains for JVM projects, the expectation is that Gretty plugin will also respect the java toolchain DSL and run containers using the specified JDK instead of one that used by Gradle.
Currently if java toolchain DSL is declared in a project, the classes compiled by the JDK specified there (e.g. v21), at the same time Gretty plugin uses Gradle JDK (e.g. v11), as result the container fails to start since JVM v11 can't load classes of java v21.
This PR purposes changes into Gretty plugin to respect java toolchain DSL:
With the following DSL the project going to use java 21 both to compile classes and to run them in container using Gretty plugin:
Related issue: #261
Complementary changed of tests:
ci.yml
to cover Gradle Java Toolchain functionality (Java 11+17 and java 17+21)docker_integration_tests.sh
that runs all tests inside docker similarly to ci.yml (helped a lot locally on Windows machine)NOTE: This PR is a forward-port of v3.x PR #306