Skip to content
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

Support for Spring Boot 3 #85

Merged
merged 51 commits into from
Sep 11, 2023
Merged

Support for Spring Boot 3 #85

merged 51 commits into from
Sep 11, 2023

Conversation

hide212131
Copy link
Contributor

@hide212131 hide212131 commented Aug 21, 2023

Resolves jhipster/generator-jhipster#22488

This PR aims to enable the upcoming JHipster 8 to build native images using Spring Boot 3 and GraalVM. This is set up as a Draft PR to be developed in phases:

Reference: mraible/blog-oauth2-native#1

@hide212131
Copy link
Contributor Author

@mshima

I have been working while referencing the jhipster/generator-jhipster#23194 branch. Since it was recently merged into the main branch, I decided to submit this PR.

I will continue my work, but if there's anything unusual about the current process or the code as it stands, I'd appreciate any comments or feedback.

@hide212131
Copy link
Contributor Author

hide212131 commented Aug 27, 2023

@mshima I'd like to tap into your wisdom.
I've split the sub generators, but ci-cd and entities haven't been executed. Everything else has been done correctly.
What setting is missing?

Here is the .yo-rc.json for the target application.

@hide212131
Copy link
Contributor Author

hide212131 commented Aug 27, 2023

@mshima My apologies. It seems that both are activated when specifying ci-cd and entities in the command line options. Sorry for the confusion.

@mshima
Copy link
Member

mshima commented Aug 28, 2023

Yes, entities generator is only executed through jdl, entities and jdl generators to generate only entities files.

You can just override the server generator at the native blueprint.
Even maven and gradle, we have then separated in main generator because on needles injection and wrapper reuse.
pom.xml is currently located at server because is quite difficult to modularize it.

@mraible
Copy link
Collaborator

mraible commented Aug 30, 2023

@hide212131 Let me know if there's anything I can do to help with this. I'm happy to help, even if it's just QAing different combinations.

@hide212131
Copy link
Contributor Author

@mraible Thank you so much! I'm very glad to hear that 😊
I've broken down the tasks for completion in the description.
I plan to tackle Gradle and PostgreSQL this weekend.
Even with the current blueprint, Maven works. If we can divide the tasks starting from Webflux, I believe we'll be able to finish much faster.

@hide212131 hide212131 marked this pull request as ready for review September 1, 2023 15:14
@hide212131 hide212131 marked this pull request as draft September 1, 2023 15:14
@mshima
Copy link
Member

mshima commented Sep 1, 2023

@hide212131 do you want me to take a look at generation error?

@hide212131
Copy link
Contributor Author

hide212131 commented Sep 1, 2023

@mshima Thank you so much for your offer.
Until now, I have been testing with the jhipster --blueprints native format, but in the CI, it's producing an error with the jhipster-native command format.
I was actually thinking that getting your insight might be the best way to resolve this issue.

@hide212131
Copy link
Contributor Author

I apologize for the confusion.
The command format wasn't the issue. Until now, I've been executing the jhipster --blueprints native on already generated code. On the CI side, the code is generated while applying the blueprint, which is the difference.

@hide212131
Copy link
Contributor Author

@mraible @mshima I've updated the blueprint's features for v8, which includes webflux.
The current status is described at the beginning. I'd appreciate any advice on the following issues:

  • The postgresql-webflux CI doesn't pass. Do you have any suggestions for resolving this? It seems it might take some time to create a minimal reproducible case in Spring Boot 3 (I believe the issue isn't related to JHipster).
    • When adding org.graalvm.buildtools.native to plugins in gradle, an error occurs in the Task: processTestAot, preventing BlockHound from launching.
    • The -XX:+AllowRedefinitionToAddDeleteMethods option has already been addressed in build.gradle.
  • The remaining CI errors are on Mac and Windows. These seem to be related to the build environment and are not associated with native compilation.

I'll be checking past issues and PRs that seem to be related to the blueprint for a while.

@mshima
Copy link
Member

mshima commented Sep 11, 2023

Windows builds are not working because -Dnative-build-args=-J-Xmx13g configuration seems to don't be working.

In any case I think we can go ahead and merge. @hide212131 is something missing at this PR?

@hide212131
Copy link
Contributor Author

@mshima Thank you so much for all your help.

If it's permissible at this point, I would appreciate it if you could merge it.
Initially, I thought I had to address all the issues listed in the beginning checklist, but I'm starting to feel that adding any more to this PR might be overloading it.
After it's merged, I'll continue to submit individual PRs for any issues I notice.

@hide212131 hide212131 marked this pull request as ready for review September 11, 2023 14:18
@mshima mshima merged commit f2e2698 into jhipster:main Sep 11, 2023
17 of 25 checks passed
@hide212131 hide212131 deleted the spring-boot-3 branch September 17, 2023 08:49
@hide212131
Copy link
Contributor Author

I believe the bug bounty should be shared with @mshima, as the completion of this PR was greatly aided by his extensive collaboration.

@mshima
Copy link
Member

mshima commented Dec 21, 2023

@hide212131 thanks I think we should split 100 for me and 400 for you.

@hide212131
Copy link
Contributor Author

@mshima Thank you.❤️ In that case, I will proceed accordingly.

@hide212131
Copy link
Contributor Author

@mshima
Copy link
Member

mshima commented Jan 5, 2024

@DanielFran
Copy link
Member

@mshima approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for compiling to native images
4 participants