-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Gretty aware of Gradle Java Toolchain (v3.x) #306
Make Gretty aware of Gradle Java Toolchain (v3.x) #306
Conversation
@mr-serjey awesome, thanks for that PR, that's definitely an important addition. Tests are failing though, can you take a look? Also, do you think there is a way to add a test for this? I wouldn't think so but if you have any ideas, that would be great. |
@boris-petrov Thanks, I will take care of failing tests. Please hint how to run all these tests locally? |
Make sure you're using JDK 11+ (actually it's best to use 11, not sure if it will work correctly with later versions) and run: ./gradlew clean build
cd integrationTests
../gradlew -PgeckoDriverPlatform=linux64 testAll We should document that somewhere... |
…mplementation (to avoid groovy jvm version limitations)
@boris-petrov, @f4lco I've finished with my changes (see updated first comment for more details). Once this PR merged (and released), I'm planning to prepare another PR with these changes for the version 4 (master). Please tell what is ETA for this PR to be released? |
@mr-serjey thank you and well done on the great work here! I'll review it in the next few days and hopefully @f4lco too. After that we'll merge and release - it won't take long. :) |
Awesome job @mr-serjey! Just a couple of minor notes:
Otherwise, again, great work! |
…lchains task depend only on those tasks/projects that support java toolchain.
Thanks for such a great review @boris-petrov , all the items make total sense and I did my best to address them:
Thanks for the feedback, please let me know if anything else needed. |
@mr-serjey thanks for the quick fixes! 1, 2, 5. Seems much better now, thanks!
Great work again! The tests seem to have failed, do you mind taking a look? Also, before merging, I would like @f4lco to take a look too as he's the smart one here. 😄 Hopefully he can do it soon. :) |
@boris-petrov Now I guess I understand you more... I migrated all application classes because initially (on local) toolchain tests was running against all projects. Now the tests are running against only 3 projects, so this groovy->java migration is needed only for them. My personal preference is to leave all application classes in java to have same approach for all of them and to distantiate from groovy/java versions alignment. But I'm ok to revert n-3 apps back to groovy if this makes more sense. PS: I'm still fixing the tests and let you guys know when I think I'm done. |
@boris-petrov, @f4lco all review items has been addressed. Please let me know if anything else need to be changed. |
No, let's leave it as it is now. I'm fine with the PR, great work! Let's give @f4lco a few days - I'll merge it after that if he doesn't answer. We can always make improvements after that. :) |
OK, I'll merge this now. @mr-serjey thanks again for the great work! I'll be releasing this in the next few days. If you can and want, maybe you can port the same PR for the @f4lco whenever you can, please take a look at this code and write here or anywhere your comments/suggestions. :) |
Thanks @boris-petrov, I will prepare master PR in a while. |
@mr-serjey I've released 3.1.4. Thanks again for the great work! |
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)