diff --git a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-discovery/src/main/java/com/alibaba/cloud/nacos/intetuntil/UtilIPv6AutoConfiguration.java b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-discovery/src/main/java/com/alibaba/cloud/nacos/intetuntil/UtilIPv6AutoConfiguration.java index 2d2a976c7..14f0c30be 100644 --- a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-discovery/src/main/java/com/alibaba/cloud/nacos/intetuntil/UtilIPv6AutoConfiguration.java +++ b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-discovery/src/main/java/com/alibaba/cloud/nacos/intetuntil/UtilIPv6AutoConfiguration.java @@ -1,11 +1,16 @@ package com.alibaba.cloud.nacos.intetuntil; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import com.alibaba.cloud.nacos.ConditionalOnNacosDiscoveryEnabled; + import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.cloud.client.ConditionalOnDiscoveryEnabled; import org.springframework.cloud.commons.util.InetUtilsProperties; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; -@EnableAutoConfiguration +@Configuration(proxyBeanMethods = false) +@ConditionalOnDiscoveryEnabled +@ConditionalOnNacosDiscoveryEnabled public class UtilIPv6AutoConfiguration { public UtilIPv6AutoConfiguration() { }