添加pom依赖
<!-- Spring Cloud Alibaba Nacos-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
yml配置文件
spring:
application:
name: business-songzixian
cloud:
nacos:
discovery:
server-addr: http://localhost:8848
启动类添加@EnableDiscoveryClient
注解
@EnableDiscoveryClient
@SpringBootApplication
public class XXXApplication {
public static void main(String[] args) {
SpringApplication.run(Oauth2BusinessApplication.class,args);
}
}
One comment
(´இ皿இ`)