mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Merge pull request #1240 from theonefx/fix/temp01
remove force dependency code of spring-cloud in AliCloudContextAutoCo…
This commit is contained in:
commit
aec251469f
@ -16,6 +16,7 @@
|
||||
|
||||
package com.alibaba.alicloud.context;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.cloud.commons.util.InetUtils;
|
||||
@ -25,15 +26,28 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author xiaolongzuo
|
||||
* @author <a href="mailto:chenxilzx1@gmail.com">theonefx</a>
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableConfigurationProperties({ AliCloudProperties.class, InetUtilsProperties.class })
|
||||
public class AliCloudContextAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public InetUtils inetUtils(InetUtilsProperties inetUtilsProperties) {
|
||||
return new InetUtils(inetUtilsProperties);
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableConfigurationProperties(AliCloudProperties.class)
|
||||
static class AliCloudPropertiesConfiguration {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableConfigurationProperties(InetUtilsProperties.class)
|
||||
@ConditionalOnClass(InetUtilsProperties.class)
|
||||
static class InetUtilsConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public InetUtils inetUtils(InetUtilsProperties inetUtilsProperties) {
|
||||
return new InetUtils(inetUtilsProperties);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user