[ISSUE #10375] Support springboot3 and native-image #306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please do not create a Pull Request without creating an issue first.
What is the purpose of the change
适配springboot3 和 native-image
Brief changelog
适配SpringBoot3
根据SpringBoot3的自动配置方式,添加org.springframework.boot.autoconfigure.AutoConfiguration.imports文件,然后更新依赖的nacos-spring-context版本
支持native-image
Verifying this change
适配SpringBoot3
首先将https://nacos.io/zh-cn/docs/nacos-spring.html里的功能都debug测试一遍,debug时统计没有走到的代码,然后运行所有单元测试即可测试上述没有走到的代码
支持native-image
新建一个项目,导入所有starter和actuator项目,开启GraalVM的Tracing Agent功能(运行java程序时添加参数:-agentlib:native-image-agent=config-output-dir=/path/to/config-dir/),将https://nacos.io/zh-cn/docs/nacos-spring.html里的功能测试一遍,之后将生成的配置文件拷贝到META-INF/native-image下,再使用spring-boot-maven-plugin的process-aot和native-maven-plugin的compile功能,运行mvn clean package -Pnative即可生成可执行程序。
运行生成的可执行程序,再将https://nacos.io/zh-cn/docs/nacos-spring.html里的功能测试一遍,功能正常即测试通过
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.