Example Analysis of springboot using nacos
Springboot uses nacos's example analysis, and it is believed that many inexperienced people are at a loss about it. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
1 、 pom.xml:
4.0.0 org.springframework.boot spring-boot-starter-parent 2.4.2 com.shif spring-jwt 0.0.1-SNAPSHOT spring-jwt Demo project for Spring Boot 1.8 0.2.1 org.springframework.cloud spring-cloud-starter-bootstrap 3.0.4 org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test test io.jsonwebtoken jjwt 0.9.0 org.projectlombok Lombok true org.springframework.boot spring-boot-starter-data-redis com.alibaba fastjson 1.2.59 com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery 2021 . 1 com.alibaba.cloud spring-cloud-starter-alibaba-nacos-config 2021.1 org.springframework.boot spring-boot-maven-plugin
For version selection, refer to the nacos official website recommendation.
2. Application.yml and bootstrap.yml:
Spring: profiles: active: dev redis: host: ${REDIS_HOST:20.20.30.125} port: ${REDIS_PORT:6379} password: ${REDIS_PASSWORD:abc@123} server: address: x.x.x.x port: 9091spring: application: name: jwttest cloud: nacos: discovery: server-addr: x.x.x.x:8848 config: server-addr: X.x.x.x:8848 group: dev file-extension: yaml after reading the above content Have you mastered the method of springboot's sample analysis using nacos? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!