Support Spring Cloud 2024.0.0
Opened this issue · 3 comments
我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。另外请按照如下要求提交相关信息节省社区维护同学的理解成本,否则该讨论极有可能直接被忽视或关闭。
We recommend using English. If you are non-native English speaker, you can use the translation software. In addition, please submit relevant information according to the following requirements to save the understanding cost of community maintenances, otherwise the discussion is very likely to be ignored or closed directly.
Which Component
Support Spring Cloud 2024.0.0 needs Supported Boot Version: 3.4.0
Additional context
https://docs.spring.io/spring-cloud-release/reference/index.html
Bean 'com.alibaba.cloud.nacos.NacosConfigAutoConfiguration' of type [com.alibaba.cloud.nacos.NacosConfigAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [nacosAnnotationProcessor] is declared through a non-static factory method on that class; consider declaring it as static instead.
除了 Spring Boot 3.4.0 和 Spring Cloud 2024.0.0 版本绑定以外,没有什么大的变化。已试过,使用 Spring Boot 3.4.0、Spring Cloud 2024.0.0 和 Spring Cloud Alibaba 2023.0.1.2 可以正常运行。
目测,适配 Spring Cloud 2024.0.0 版本,Spring Cloud Alibaba 新建个分支,改个版本号即可。
@autoConfiguration
@conditional(NacosConfigEnabledCondition.class)
public class CustomNacosConfigAutoConfiguration {
@Bean
public NacosConfigProperties nacosConfigProperties(ApplicationContext context) {
if (context.getParent() != null && BeanFactoryUtils.beanNamesForTypeIncludingAncestors(context.getParent(),
NacosConfigProperties.class).length > 0) {
return BeanFactoryUtils.beanOfTypeIncludingAncestors(context.getParent(), NacosConfigProperties.class);
}
if (NacosConfigManager.getInstance() == null) {
return new NacosConfigProperties();
}
else {
return NacosConfigManager.getInstance().getNacosConfigProperties();
}
}
@Bean
public static NacosAnnotationProcessor nacosAnnotationProcessor() {
return new NacosAnnotationProcessor();
}
}