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 Framework 6 and Spring Boot 3 #10941

Merged
merged 8 commits into from
Nov 22, 2022
Merged

Conversation

weixsun
Copy link
Contributor

@weixsun weixsun commented Nov 15, 2022

This commit is closing gh-10565

What is the purpose of the change

  • Support for Spring Framework 6.0.0
  • Support for Spring Boot 3.0.0
    • Support new Auto-configuration mechanism in Spring Boot 3
      Since Spring Boot 3, loading Auto-configuration classes is supported with .imports files only.
      In order to be compatible with the lower version of Spring Boot, we have retained the spring.factories file
  • Enhance ReferenceAnnotationBeanPostProcessor to be compatible with Spring & Spring Boot lower versions
  • Introduce TestSocketUtils to replace SocketUtils

Checklist

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

@weixsun weixsun force-pushed the gh-10565 branch 3 times, most recently from e772f9a to 1efed55 Compare November 16, 2022 15:29
@@ -83,7 +83,7 @@ public class EmbeddedZooKeeper implements SmartLifecycle {
* Construct an EmbeddedZooKeeper with a random port.
*/
public EmbeddedZooKeeper() {
clientPort = SocketUtils.findAvailableTcpPort();
clientPort = TestSocketUtils.findAvailableTcpPort();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SocketUtils has been removed in Spring Framework 6.0 M3. see spring-projects/spring-framework#28052

…ties

`InstantiationAwareBeanPostProcessor#postProcessPropertyValues` removed as of Spring Framework 6.0.0, in favor of `postProcessProperties` method.
Try to avoid using @javax.annotation.Resource to inject beans.

Package javax.* has been migrated to jakarta.* in Jakarta EE 9.
Since Spring Boot 3, loading Auto-configuration classes is supported with `.imports` files only.

In order to be compatible with the lower version of Spring Boot, we have retained the spring.factories file
…oot 3

With this commit, dubbo integration spring-boot-actuator will follow the same conditions regardless of Spring Boot version.

This file was created on purpose only to satisfy the reasons above.
@weixsun weixsun changed the title Upgrade to Spring Framework 6 and Spring Boot 3 Support for Spring Framework 6 and Spring Boot 3 Nov 19, 2022
@weixsun weixsun requested a review from CrazyHZM November 19, 2022 17:44
@gitchenjh
Copy link
Contributor

In my opinion SocketUtils are only used in test scope,unless Dubbo upgraded Spring base line to 6.x and later, it's not really necessary to replace them

@weixsun
Copy link
Contributor Author

weixsun commented Nov 21, 2022

In my opinion SocketUtils are only used in test scope,unless Dubbo upgraded Spring base line to 6.x and later, it's not really necessary to replace them

@gitchenjh we should put the work ahead and provide convenience for possible maven profile with Spring 6.x.

@CrazyHZM
Copy link
Member

@weixsun
There is a Security Hotspot in Sonar code Analysis that needs to be fixed

@weixsun weixsun requested review from CrazyHZM and AlbumenJ and removed request for CrazyHZM and AlbumenJ November 21, 2022 08:24
@weixsun
Copy link
Contributor Author

weixsun commented Nov 21, 2022

@weixsun There is a Security Hotspot in Sonar code Analysis that needs to be fixed

Done.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 19 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@weixsun weixsun requested review from CrazyHZM and AlbumenJ and removed request for CrazyHZM and AlbumenJ November 21, 2022 11:46
Copy link
Member

@CrazyHZM CrazyHZM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@weixsun weixsun requested a review from AlbumenJ November 21, 2022 15:52
Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlbumenJ AlbumenJ merged commit 423f4ec into apache:3.2 Nov 22, 2022
@CrazyHZM CrazyHZM added this to the 3.2.0 milestone Nov 22, 2022
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.

4 participants