springboot使用nacos的示例详解

网友投稿 366 2022-09-08


springboot使用nacos的示例详解

1、pom.xml:

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

org.springframework.boot

spring-boot-starter-parent

2.4.2

com.shif

spring-jwt

0.0.1-SNAPSHOT

spring-jhttp://wt

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

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

org.springframework.boot

spring-boot-starter-parent

2.4.2

com.shif

spring-jwt

0.0.1-SNAPSHOT

spring-jhttp://wt

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

版本选择参考nacos官网推荐

2、application.yml和bootstrap.yml:

spring:

profiles:

active: dev

redis:

host: ${REDIS_HOST:20.20.30.125}

port: ${REDIS_PORT:6379}

password: ${REDIShttp://_PASSWORD:abc@123}

server:

address: x.x.x.x

port: 9091

spring:

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


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:#yyds干货盘点#python文本自动换行与填充
下一篇:# yyds干货盘点 # Python面向对象中的类变量,实例变量怎么来理解?
相关文章

 发表评论

暂时没有评论,来抢沙发吧~