nacos与eureak依赖冲突

Field autoServiceRegistration in org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration required a single bean, but 2 were found:
- nacosAutoServiceRegistration: defined by method ‘nacosAutoServiceRegistration’ in class path resource [com/alibaba/cloud/nacos/registry/NacosServiceRegistryAutoConfiguration.class]
- eurekaAutoServiceRegistration: defined by method ‘eurekaAutoServiceRegistration’ in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.class]

解决方法
在pom和yml文件里面注解其中一个依赖即可

你可能感兴趣的:(java,开发语言)