quickperf icon indicating copy to clipboard operation
quickperf copied to clipboard

Provide compatibility with Spring Boot 3

Open klu2 opened this issue 2 years ago • 11 comments

Description The library currently does not work with Spring Boot 3. The problem is that already in Spring Boot 2.7 there was a change how to load AutoConfiguration, see https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.7-Release-Notes#building-jars-with-maven-shade-plugin-and-gradle-shadow-plugin

Implementation ideas

What we need is a file called org.springframework.boot.autoconfigure.AutoConfiguration.imports inside src/main/resources/META-INF/spring with the following content:

org.quickperf.spring.boot.QuickPerfProxyBeanAutoConfiguration

I see 2 options:

  1. create a module quick-perf-springboot3-sql-starter

drawback: additional module, code duplication with springboot2

  1. modify the existing quick-perf-springboot2-sql starter and add the org.springframework.boot.autoconfigure.AutoConfiguration.imports file there

drawback: will require at least Spring Boot 2.7 but if you leave the old file as well (spring.factories), all versions (also Spring Boot 3.0) would work, so I'd prefer that option

klu2 avatar Jan 12 '23 11:01 klu2

Thank you @klu2 for having reported and analyzed this problem! I agree with your analysis. Would you be interested in creating a PR to fix the problem?

jeanbisutti avatar Jan 12 '23 22:01 jeanbisutti

@klu2 I have deployed a snapshot version (1.1.1-SNAPSHOT) with the fix. You may want to check that the SQL annotations now work with Spring Boot 3.

jeanbisutti avatar Jan 16 '23 22:01 jeanbisutti

hi @jeanbisutti thanks - I have tested that already in another library that we are publishing (https://github.com/cloudflightio/cloudflight-platform-spring) where I temporarily add that file to our library which loads quickperf transitively (https://github.com/cloudflightio/cloudflight-platform-spring/blob/master/platform-spring-test-bom/platform-spring-test-jpa/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports) and that works perfectly fine with Spring Boot 3, we are running that already.

As soon as you've published a release, I will update the version in our library and remove that file again from our code-base.

klu2 avatar Jan 17 '23 05:01 klu2

@jeanbisutti when do you plan to release 1.1.1?

maciejwalkowiak avatar Feb 21 '23 07:02 maciejwalkowiak

@maciejwalkowiak I will try my best to do a release in March. Waiting for the release you can apply this workaround for this issue.

jeanbisutti avatar Feb 21 '23 09:02 jeanbisutti

Thanks @jeanbisutti! If there's anything I can help regarding migration to Spring Boot 3 let me know.

maciejwalkowiak avatar Feb 23 '23 06:02 maciejwalkowiak

any updates on this @jeanbisutti ?

NaitYoussef avatar Oct 02 '23 08:10 NaitYoussef

@NaitYoussef I have been pretty busy these last months... Thank you for the reminder. I will try to a a release soon. For this issue, you can apply this workaround.

jeanbisutti avatar Oct 03 '23 09:10 jeanbisutti

Workaround: https://github.com/quick-perf/quickperf/issues/196#issuecomment-1384864117

jeanbisutti avatar Oct 03 '23 09:10 jeanbisutti

@jeanbisutti I don't want to nag you periodically but it would be great to release 1.1.1. Is there anything I can do to help? I'd like to avoid forking this project but maybe it is a right thing to do?

maciejwalkowiak avatar Mar 03 '24 13:03 maciejwalkowiak

Hey @maciejwalkowiak If you want to help, you can document #175. The documentation is done in the wiki: https://github.com/quick-perf/doc/wiki/QuickPerf Just fork the wiki and do the modifications on your copy. Thanks.

jeanbisutti avatar Mar 03 '24 22:03 jeanbisutti