SpringCloud Hoxton.SR3版本 配置中心config搭建教程

引言

最近在搭建配置中心的时候遇到了很多问题,因为刚开始接触springcloud 对里面的很多只是并不是很了解,但是看了文档以后觉得 应该是很简单的,结果在搭建过程中都是大坑啊。下面先介绍正确的配置过程,然后在分享其中遇到的坑。

项目版本

spring-boot-version:2.2.5.RELEASE

spring-cloud.version:Hoxton.SR3

注意:spring cloud 不同版本之间的差异还是很大的,所以读者一定要注意自己的版本

本文中的实例采用maven+父子工程的结构来实现,client端和server端拥有相同的父工程。

父工程搭建

关于如何创建工程这里就不介绍了,父工程中最为关键的部分就是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 http://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.2.5.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>com.jack.springcloud</groupId>
    <artifactId>weather</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <modules>
        <module>weatherconfigserver</module>
        <module>weatherconfigclient</module>
    </modules>

    <name>weather</name>
    <!-- FIXME change it to the project's website -->
    <url>http://www.example.com</url>

    <propert
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

g-Jack

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值