jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.56k stars 4.02k forks source link

Upgrade to Spring Boot 3 #19782

Closed mraible closed 1 year ago

mraible commented 2 years ago
Overview of the feature request

Start upgrading to Spring Boot 3.

Motivation for or Use Case

Selfishly, I need it for a demo at ApacheCon, but I'd also like to hack on it during the JavaOne Hackergarten.

Related issues or PR
DanielFran commented 2 years ago

@mraible We should consider to migrate from zalando (problem and problem-spring-web) to spring-framework native implementation coming with spring-framework 6.0

@pascalgrimaud same for JHLite

pascalgrimaud commented 2 years ago

Thanks for the information @DanielFran !

mraible commented 2 years ago

I'm looking for issues to try and fix at the JavaOne Hackergarten, so this could be a candidate.

Does anyone know how to fix the compilation errors from Hibernate? Do we still need the fixed PostgreSQL dialects in jhipster-framework?

DanielFran commented 2 years ago

@mraible @pascalgrimaud This might be helpful: https://github.com/rstoyanchev/sandbox-rfc7807

DanielFran commented 2 years ago

I'm looking for issues to try and fix at the JavaOne Hackergarten, so this could be a candidate.

Does anyone know how to fix the compilation errors from Hibernate? Do we still need the fixed PostgreSQL dialects in jhipster-framework?

@mraible The fixed PostgreSQL dialect was needed for BLOB integration: https://github.com/jhipster/jhipster-bom/blob/main/jhipster-framework/src/main/java/tech/jhipster/domain/util/FixedPostgreSQL10Dialect.java#L37-L39

We just need to confirm hibernate 6 handles it now: https://docs.jboss.org/hibernate/orm/6.1/userguide/html_single/Hibernate_User_Guide.html#basic-blob

mraible commented 2 years ago

@mraible @pascalgrimaud This might be helpful: https://github.com/rstoyanchev/sandbox-rfc7807

@DanielFran This looks very helpful. Do you know if we need to extend the exception handler like WebMvcExceptionHandler.java does in this example? Or can we just declare a bean that returns the parent exception handler?

Related: do we need to register this exception handler with Spring Security?

mraible commented 2 years ago

A fix for Spring Doc might exist in this PR:

https://github.com/springdoc/springdoc-openapi/pull/1860

DanielFran commented 2 years ago

@mraible @pascalgrimaud This might be helpful: https://github.com/rstoyanchev/sandbox-rfc7807

@DanielFran This looks very helpful. Do you know if we need to extend the exception handler like WebMvcExceptionHandler.java does in this example? Or can we just declare a bean that returns the parent exception handler?

Related: do we need to register this exception handler with Spring Security?

Seems that WebMvcExceptionHandler.java example is like our current https://github.com/jhipster/generator-jhipster/blob/main/generators/server/templates/src/main/java/package/web/rest/errors/ExceptionTranslator.java.ejs But we would need to implement those exceptions https://github.com/zalando/problem-spring-web/tree/main/problem-spring-web#configuration

DanielFran commented 2 years ago

A fix for Spring Doc might exist in this PR:

springdoc/springdoc-openapi#1860

We still have some spring.factories in the generator (for testing purposes with testcontainer I believe) to change also. In the bom, I already migrated them when upgrading to 2.7.0

mraible commented 2 years ago

Seems that WebMvcExceptionHandler.java example is like our current https://github.com/jhipster/generator-jhipster/blob/main/generators/server/templates/src/main/java/package/web/rest/errors/ExceptionTranslator.java.ejs But we would need to implement those exceptions https://github.com/zalando/problem-spring-web/tree/main/problem-spring-web#configuration

It looks like Spring Boot might fix this by adding problem support by default. https://github.com/spring-projects/spring-boot/issues/32634

mraible commented 2 years ago

I added new issues with bug bounties for Elasticsearch and the Zalando migration.

omnya-alaa-eddin commented 1 year ago

Hi Matt Raible , how can I pull your changes in order to generate new app that is internally using spring 3 Thanks for your effort regarding this fixes :)

mraible commented 1 year ago
git clone https://github.com/jhipster/generator-jhipster.git
cd generator-jhipster
npm install
npm link

Then, create a new directory and run jhipster in it.

mkdir app
cd app
jhipster

I've had a lot of questions about this recently. I plan to make a video this week.

omnya-alaa-eddin commented 1 year ago

Hi @mraible Thanks for your response. I'm trying to generate new app using the main branch and I'm expecting to get new app with spring 3
but I got the below error when trying to generate the new app using command (jhipster), Any Advice please ?

image

mraible commented 1 year ago

Can you please provide the steps you used to reproduce this error. Or, better yet, copy/paste your .yo-rc.json as a comment?

For a quick fix, you might try changing the base-url value to remove the trailing colon.

pascalgrimaud commented 1 year ago

You already provided the steps, @mraible The main branch is simply broken when you want to generate a project from scratch. Just tried it few minutes ago:

image

Tcharl commented 1 year ago

Reproduced locally, I reopen

pascalgrimaud commented 1 year ago

It's not related to Spring Boot 3, so I think we should open a new dedicated ticket instead of reopening this one

Tcharl commented 1 year ago

PR provided, too lazy for a ticket, was too easy to fix directly ^^

mshima commented 1 year ago

This new bug is not related to sb3, but to the prompts/defaults refactoring. I don’t know why this issue was reopen.

Tcharl commented 1 year ago

Closing in favor of the dedicated issue.

mshima commented 1 year ago

Half work was done by @mraible, but since he usually don't claim, I will claim full 😄 @DanielFran bounty claimed https://opencollective.com/generator-jhipster/expenses/148964

DanielFran commented 1 year ago

@mshima approved