Follow this checklist to help us incorporate your contribution quickly and easily:
[x] Make sure there is a Github issue filed 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.
[x] Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
[x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
[x] 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 integration-test in test module.
[ ] Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
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
添加native-image编译所需的配置文件,然后导入nacos-spring-context-aot依赖
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.