zoukankan      html  css  js  c++  java
  • 初尝Spring Cloud Config

    1,下载源码

         地址https://spring.io/guides/gs/centralized-configuration/

    2,导入工程

        解压后分别把Server端与Client端导入到两个Eclipse中,以便测试

    3,修改源码中pom.xml为如下形式

        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-dependencies</artifactId>
                    <version>Finchley.RELEASE</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>

    4,修改Server端配置,采用本地仓库

    spring.cloud.config.server.git.uri=d:/config

    5,创建本地仓库

    在d:config目录新增文件a-bootiful-client.properties,文件内容只需一行

    message = Hello Terry

    在dos下下执行git命令

    git init;
    
    git add a-bootiful-client.properties
    
    git commit -m 'first bommit'

    6,启动服务端以及客户端,访问http://localhost:92/message,就能看到程序运行结果

    参照文档:https://spring.io/guides/gs/centralized-configuration/

  • 相关阅读:
    分组声明
    描述项目的典型用户与场景
    用户调研
    10-11-12
    Sprint--5.21
    Cosplay之孩子的妈咪
    作业5.1之5.2
    51nod 1393 1393 0和1相等串
    51nod 1090 3个数和为0(排序+二分)
    51nod 1095 Anigram单词(map的使用)
  • 原文地址:https://www.cnblogs.com/season2009/p/9437710.html
Copyright © 2011-2022 走看看