From dc9933e1e8e74ab750d5380ea3ce5cb551503957 Mon Sep 17 00:00:00 2001 From: "felord.cn" Date: Wed, 20 Jan 2021 15:16:23 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=99=8D=E4=BD=8E=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E7=9B=B8=E5=85=B3=E7=9A=84Spring=20Bean=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E4=BC=98=E5=85=88=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 降低配置初始化的优先级,以适应Apollo等配置中心 --- .../wechat/WechatPayConfiguration.java | 2 +- .../wechat/WechatPayConfiguredCondition.java | 5 +- pom.xml | 100 +++++++++++------- 3 files changed, 65 insertions(+), 42 deletions(-) diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/WechatPayConfiguration.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/WechatPayConfiguration.java index 9878264..c65b521 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/WechatPayConfiguration.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/WechatPayConfiguration.java @@ -34,7 +34,7 @@ import java.util.Map; * @author felord.cn * @since 1.0.0.RELEASE */ -@Configuration +@Configuration(proxyBeanMethods = false) @Conditional(WechatPayConfiguredCondition.class) @EnableConfigurationProperties(WechatPayProperties.class) public class WechatPayConfiguration { diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/WechatPayConfiguredCondition.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/WechatPayConfiguredCondition.java index bb624a8..cea7905 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/WechatPayConfiguredCondition.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/WechatPayConfiguredCondition.java @@ -24,6 +24,7 @@ import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.context.annotation.ConditionContext; +import org.springframework.core.annotation.Order; import org.springframework.core.env.Environment; import org.springframework.core.type.AnnotatedTypeMetadata; @@ -37,6 +38,7 @@ import java.util.stream.Collectors; * @author felord.cn * @since 1.0.3.RELEASE */ +@Order public class WechatPayConfiguredCondition extends SpringBootCondition { /** @@ -57,7 +59,8 @@ public class WechatPayConfiguredCondition extends SpringBootCondition { } private Map getV3(Environment environment) { - return Binder.get(environment).bind("wechat.pay.v3", STRING_WECHAT_V3_MAP) + return Binder.get(environment) + .bind("wechat.pay.v3", STRING_WECHAT_V3_MAP) .orElse(Collections.emptyMap()); } diff --git a/pom.xml b/pom.xml index 9f656a7..2d7d489 100644 --- a/pom.xml +++ b/pom.xml @@ -132,62 +132,82 @@ + + + + org.apache.maven.plugins + maven-source-plugin + 3.1.0 + + + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + private + true + UTF-8 + UTF-8 + UTF-8 + + + + compile + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + true + + sonatype-nexus-staging + https://oss.sonatype.org/ + + + + org.apache.maven.plugins maven-source-plugin - 3.1.0 - - - package - - jar-no-fork - - - org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 - - private - true - UTF-8 - UTF-8 - UTF-8 - - - - compile - - jar - - - org.apache.maven.plugins maven-gpg-plugin - 1.6 - - - verify - - sign - - - org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 - true - - sonatype-nexus-staging - https://oss.sonatype.org/ -