首页 > 作文

springboot使用nacos的示例详解

更新时间:2023-04-04 04:12:20 阅读: 评论:0

1、pom.xml:

<?xml version="1.0" encoding="utf-8"?><project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="/d/file/titlepic/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>    <parent>        <groupid>org.springframework.boot</groupid>        <artifactid>spring-boot-starter-parent<体质检测仪;/artifactid>        <version>2.4.2</version>        <relativepath/>     </parent>    <groupid>com.shif</groupid>    <artifactid>spring-jwt</artifactid>    <version>0.0.1-snapshot</version>    <name>spring-jwt</name>    <description>demo project for spring boot</description>    <properties>        <java.version>1.8</java.version>        <nacos-config-spring-boot.version>0.2.1</nacos-config-spring-boot.version>    </properties>    <dependencies>        <!-- 解决启动param 'rvicename' is illegal, rvicename is blank问题 -->        <dependency>            <groupid>org.springframework.cloud</groupid>            <artifactid>spring-cloud-starter-bootstrap</artifactid>            <version>3.0.4</version>        </dependency>        <dependency>            <groupid>org.springframework.boot</groupid>            <artifactid>spring-boot-starter-web</artifactid>        </dependency>        <dependency>            <groupid>org.springframework.boot</groupid>            <artifactid>spring-boot-starter-test</artifactid>            <scope>test</scope>        </dependency>        <dependency>            <groupid>io.jso立体画教程nwebtoken</groupid>            <artifactid>jjwt</artifactid>            <version>0.9.0</version>        </dependency>        <dependency>            <groupid>org.projectlombok</groupid>            <artifactid>lombok</artifactid>            <optional>true</optional>        </dependency>        <dependency>            <groupid>org.springframework.boot</groupid>            <artifactid>spring-boot-starter-data-redis</artifactid>        </dependency>        <dependency>            <groupid>com.alibaba</groupid>            <artifactid>fastjson</artifactid>            <version>1.2.59</version>        </dependency>        <!-- nacos discovery and config 版本选择参考nacos官网推荐-->        <dependency>            <groupid>com.alibaba.cloud</groupid>            <artifactid>spring-cloud-starter-alibaba-nacos-discovery</artifactid>            <version>2021.1</version>        </dependency>        <dependency>            <groupid>com.alibaba.cloud</groupid>            <artifactid>spring-cloud-starter-alibaba-nacos-config</artifactid>          封闭学校  <version>2021.1</version>        </dependency>    </dependencie刀锋教育s>    <build>        <plugins>            <plugin>                <groupid>org.springframework.boot</groupid>                <artifactid>spring-boot-maven-plugin</artifactid>            </plugin>        </plugins>    </build></project>

版本选择参考nacos官网推荐

2、application.yml和bootstrap.yml:

spring:  profiles:    active: dev  redis:    host: ${redis_host:20.20.30.125}    port: ${redis_port:6379}    password: ${redis_password:abc@123}
美丽的小兴安岭rver:  address: x.x.x.x  port: 9091spring:  application:    name: jwttest  cloud:    nacos:      discovery:        rver-addr: x.x.x.x:8848      config:        rver-addr: x.x.x.x:8848        group: dev        file-extension: yaml

到此这篇关于springboot使用nacos的示例详解的文章就介绍到这了,更多相关springboot使用nacos内容请搜索www.887551.com以前的文章或继续浏览下面的相关文章希望大家以后多多支持www.887551.com!

本文发布于:2023-04-04 04:12:17,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/00cbc02378e250133a5915a7ae44077b.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:springboot使用nacos的示例详解.doc

本文 PDF 下载地址:springboot使用nacos的示例详解.pdf

标签:小兴安岭   官网   版本   文章
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图
  • 我要关灯
    我要开灯
  • 返回顶部