springboot spring-cloud spring-cloud nacos 整合模板
生活随笔
收集整理的這篇文章主要介紹了
springboot spring-cloud spring-cloud nacos 整合模板
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
文章目錄
- 二、coding實戰(zhàn)
- 2.1. 版本對照
- 2.2. 線上采用版本
- 2.3. yml文件配置
- 2.4. pom依賴
- 2.5. 效果圖
二、coding實戰(zhàn)
2.1. 版本對照
先閱讀->版本說明
2.2. 線上采用版本
| 2.2.7.RELEASE | Spring Cloud Hoxton.SR12 | 2.3.12.RELEASE | 2.0.3 |
2.3. yml文件配置
bootstrap.yml
# Tomcat server:port: 8080# Spring spring:application:# 應用名稱name: ly-gatewayprofiles:# 環(huán)境配置active: devcloud:nacos:discovery:# nacos 認證密碼username: nacos# nacos 認證密碼password: kwx_!2022@O^# 服務注冊地址server-addr: 127.0.0.1:8848config:# 配置中心地址server-addr: 127.0.0.1:8848# nacos 認證用戶username: nacos# nacos 認證密碼password: kwx_!2022@O^# 配置文件格式file-extension: yml# 共享配置shared-configs:- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}2.4. pom依賴
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.gblfy</groupId><artifactId>nacos</artifactId><version>1.0.0</version><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.3.12.RELEASE</version><relativePath/></parent><properties><spring-cloud.version>Hoxton.SR12</spring-cloud.version><spring-cloud-alibaba.version>2.2.7.RELEASE</spring-cloud-alibaba.version><nacos-client.version>2.0.3</nacos-client.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><!--服務注冊發(fā)現(xiàn)--><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId><exclusions><exclusion><groupId>com.alibaba.nacos</groupId><artifactId>nacos-client</artifactId></exclusion></exclusions></dependency><!--配置管理--><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId><exclusions><exclusion><groupId>com.alibaba.nacos</groupId><artifactId>nacos-client</artifactId></exclusion></exclusions></dependency><dependency><groupId>com.alibaba.nacos</groupId><artifactId>nacos-client</artifactId><version>${nacos-client.version}</version></dependency></dependencies><dependencyManagement><dependencies><!-- SpringCloud 微服務 --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>${spring-cloud.version}</version><type>pom</type><scope>import</scope></dependency><!-- SpringCloud Alibaba 微服務 --><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-alibaba-dependencies</artifactId><version>${spring-cloud-alibaba.version}</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>2.5. 效果圖
總結(jié)
以上是生活随笔為你收集整理的springboot spring-cloud spring-cloud nacos 整合模板的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SSL/TLS协议信息泄露漏洞(CVE-
- 下一篇: Vue Bootstrap OSS 实现