From dd84e0d51974e616a2274e6faadb96aab9ddc81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Fri, 16 Sep 2022 10:37:03 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=8D=87=E7=BA=A7=20Spring-Cloud-Alib?= =?UTF-8?q?aba=202021.0.1.0=20=3D>=202021.0.4.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-common/ruoyi-common-alibaba-bom/pom.xml | 28 ++++++------- .../main/resources/META-INF/spring.factories | 2 - ....boot.env.EnvironmentPostProcessor.imports | 1 + .../main/resources/META-INF/spring.factories | 2 - ....boot.env.EnvironmentPostProcessor.imports | 1 + .../ruoyi/common/web/config/NacosConfig.java | 39 ------------------- .../common/web/nacos/CustomNacosWatch.java | 25 ------------ ...ot.autoconfigure.AutoConfiguration.imports | 1 - ruoyi-example/ruoyi-demo/pom.xml | 11 +++--- ruoyi-example/ruoyi-stream-mq/pom.xml | 11 +++--- 10 files changed, 24 insertions(+), 97 deletions(-) delete mode 100644 ruoyi-common/ruoyi-common-elasticsearch/src/main/resources/META-INF/spring.factories create mode 100644 ruoyi-common/ruoyi-common-elasticsearch/src/main/resources/META-INF/spring/org.springframework.boot.env.EnvironmentPostProcessor.imports delete mode 100644 ruoyi-common/ruoyi-common-loadbalancer/src/main/resources/META-INF/spring.factories create mode 100644 ruoyi-common/ruoyi-common-loadbalancer/src/main/resources/META-INF/spring/org.springframework.boot.env.EnvironmentPostProcessor.imports delete mode 100644 ruoyi-common/ruoyi-common-web/src/main/java/com/ruoyi/common/web/config/NacosConfig.java delete mode 100644 ruoyi-common/ruoyi-common-web/src/main/java/com/ruoyi/common/web/nacos/CustomNacosWatch.java diff --git a/ruoyi-common/ruoyi-common-alibaba-bom/pom.xml b/ruoyi-common/ruoyi-common-alibaba-bom/pom.xml index 866576e3..3d225818 100644 --- a/ruoyi-common/ruoyi-common-alibaba-bom/pom.xml +++ b/ruoyi-common/ruoyi-common-alibaba-bom/pom.xml @@ -14,15 +14,11 @@ - 2021.0.1.0 - 3.1.1 + 2021.0.4.0 1.8.5 - 1.6 - 0.8.0 - 2.2.1 - 1.1.0 - 2.0.2 1.5.2 + 2.1.1 + 2.0.4 3.1.0 1.0.11 @@ -107,47 +103,47 @@ com.alibaba.csp - sentinel-dubbo-adapter + sentinel-reactor-adapter ${sentinel.version} com.alibaba.csp - sentinel-apache-dubbo-adapter + sentinel-cluster-server-default ${sentinel.version} com.alibaba.csp - sentinel-apache-dubbo3-adapter + sentinel-cluster-client-default ${sentinel.version} com.alibaba.csp - sentinel-reactor-adapter + sentinel-spring-webflux-adapter ${sentinel.version} com.alibaba.csp - sentinel-cluster-server-default + sentinel-api-gateway-adapter-common ${sentinel.version} com.alibaba.csp - sentinel-cluster-client-default + sentinel-spring-webmvc-adapter ${sentinel.version} com.alibaba.csp - sentinel-spring-webflux-adapter + sentinel-dubbo-adapter ${sentinel.version} com.alibaba.csp - sentinel-api-gateway-adapter-common + sentinel-apache-dubbo-adapter ${sentinel.version} com.alibaba.csp - sentinel-spring-webmvc-adapter + sentinel-apache-dubbo3-adapter ${sentinel.version} diff --git a/ruoyi-common/ruoyi-common-elasticsearch/src/main/resources/META-INF/spring.factories b/ruoyi-common/ruoyi-common-elasticsearch/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 1dbf1036..00000000 --- a/ruoyi-common/ruoyi-common-elasticsearch/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.env.EnvironmentPostProcessor=\ - com.ruoyi.common.elasticsearch.config.ActuatorEnvironmentPostProcessor diff --git a/ruoyi-common/ruoyi-common-elasticsearch/src/main/resources/META-INF/spring/org.springframework.boot.env.EnvironmentPostProcessor.imports b/ruoyi-common/ruoyi-common-elasticsearch/src/main/resources/META-INF/spring/org.springframework.boot.env.EnvironmentPostProcessor.imports new file mode 100644 index 00000000..5e75a00f --- /dev/null +++ b/ruoyi-common/ruoyi-common-elasticsearch/src/main/resources/META-INF/spring/org.springframework.boot.env.EnvironmentPostProcessor.imports @@ -0,0 +1 @@ +com.ruoyi.common.elasticsearch.config.ActuatorEnvironmentPostProcessor diff --git a/ruoyi-common/ruoyi-common-loadbalancer/src/main/resources/META-INF/spring.factories b/ruoyi-common/ruoyi-common-loadbalancer/src/main/resources/META-INF/spring.factories deleted file mode 100644 index d5686dbb..00000000 --- a/ruoyi-common/ruoyi-common-loadbalancer/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.env.EnvironmentPostProcessor=\ - com.ruoyi.common.loadbalance.config.CustomEnvironmentPostProcessor diff --git a/ruoyi-common/ruoyi-common-loadbalancer/src/main/resources/META-INF/spring/org.springframework.boot.env.EnvironmentPostProcessor.imports b/ruoyi-common/ruoyi-common-loadbalancer/src/main/resources/META-INF/spring/org.springframework.boot.env.EnvironmentPostProcessor.imports new file mode 100644 index 00000000..97d6af0d --- /dev/null +++ b/ruoyi-common/ruoyi-common-loadbalancer/src/main/resources/META-INF/spring/org.springframework.boot.env.EnvironmentPostProcessor.imports @@ -0,0 +1 @@ +com.ruoyi.common.loadbalance.config.CustomEnvironmentPostProcessor diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/com/ruoyi/common/web/config/NacosConfig.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/ruoyi/common/web/config/NacosConfig.java deleted file mode 100644 index 08e38433..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/ruoyi/common/web/config/NacosConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.ruoyi.common.web.config; - -import com.alibaba.cloud.nacos.ConditionalOnNacosDiscoveryEnabled; -import com.alibaba.cloud.nacos.NacosDiscoveryProperties; -import com.alibaba.cloud.nacos.NacosServiceManager; -import com.alibaba.cloud.nacos.discovery.NacosDiscoveryAutoConfiguration; -import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientConfiguration; -import com.alibaba.cloud.nacos.discovery.NacosWatch; -import com.ruoyi.common.web.nacos.CustomNacosWatch; -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.cloud.client.ConditionalOnBlockingDiscoveryEnabled; -import org.springframework.cloud.client.ConditionalOnDiscoveryEnabled; -import org.springframework.context.annotation.Bean; - -/** - * 自定义 nacos 监听 解决与 Undertow 整合报错问题 - * - * @author Lion Li - */ -@ConditionalOnClass(NacosWatch.class) -@AutoConfiguration( - before = NacosDiscoveryClientConfiguration.class, - after = NacosDiscoveryAutoConfiguration.class -) -@ConditionalOnDiscoveryEnabled -@ConditionalOnBlockingDiscoveryEnabled -@ConditionalOnNacosDiscoveryEnabled -public class NacosConfig { - - @Bean - @ConditionalOnProperty(value = "spring.cloud.nacos.discovery.watch.enabled", matchIfMissing = true) - public NacosWatch nacosWatch(NacosServiceManager nacosServiceManager, - NacosDiscoveryProperties nacosDiscoveryProperties) { - return new CustomNacosWatch(nacosServiceManager, nacosDiscoveryProperties); - } - -} diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/com/ruoyi/common/web/nacos/CustomNacosWatch.java b/ruoyi-common/ruoyi-common-web/src/main/java/com/ruoyi/common/web/nacos/CustomNacosWatch.java deleted file mode 100644 index 8aacb509..00000000 --- a/ruoyi-common/ruoyi-common-web/src/main/java/com/ruoyi/common/web/nacos/CustomNacosWatch.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ruoyi.common.web.nacos; - -import com.alibaba.cloud.nacos.NacosDiscoveryProperties; -import com.alibaba.cloud.nacos.NacosServiceManager; -import com.alibaba.cloud.nacos.discovery.NacosWatch; - -/** - * 自定义 nacos 监听 - * - * @author Lion Li - */ -public class CustomNacosWatch extends NacosWatch { - - public CustomNacosWatch(NacosServiceManager nacosServiceManager, NacosDiscoveryProperties properties) { - super(nacosServiceManager, properties); - } - - /** - * 重写解决与 Undertow 关闭顺序冲突导致报错问题 - */ - @Override - public int getPhase() { - return Integer.MAX_VALUE; - } -} diff --git a/ruoyi-common/ruoyi-common-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-common/ruoyi-common-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 043902cc..ee90b919 100644 --- a/ruoyi-common/ruoyi-common-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/ruoyi-common/ruoyi-common-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,3 +1,2 @@ com.ruoyi.common.web.config.I18nConfig com.ruoyi.common.web.config.UndertowConfig -com.ruoyi.common.web.config.NacosConfig diff --git a/ruoyi-example/ruoyi-demo/pom.xml b/ruoyi-example/ruoyi-demo/pom.xml index e4ee801a..8ab440cf 100644 --- a/ruoyi-example/ruoyi-demo/pom.xml +++ b/ruoyi-example/ruoyi-demo/pom.xml @@ -29,12 +29,6 @@ spring-cloud-starter-alibaba-nacos-config - - - com.alibaba.cloud - spring-cloud-starter-alibaba-sentinel - - org.springframework.boot @@ -47,6 +41,11 @@ mysql-connector-java + + com.ruoyi + ruoyi-common-sentinel + + com.ruoyi ruoyi-common-log diff --git a/ruoyi-example/ruoyi-stream-mq/pom.xml b/ruoyi-example/ruoyi-stream-mq/pom.xml index 7411ae10..f6c7a3c9 100644 --- a/ruoyi-example/ruoyi-stream-mq/pom.xml +++ b/ruoyi-example/ruoyi-stream-mq/pom.xml @@ -29,12 +29,6 @@ spring-cloud-starter-alibaba-nacos-config - - - com.alibaba.cloud - spring-cloud-starter-alibaba-sentinel - - org.springframework.cloud spring-cloud-starter-stream-rabbit @@ -56,6 +50,11 @@ spring-boot-starter-actuator + + com.ruoyi + ruoyi-common-sentinel + + com.ruoyi ruoyi-common-security