spring cloud config server搭建本地配置系统( 三 )


                   </plugins>
         </build>
</project>

spring cloud config server搭建本地配置系统



3添加利用注解@EnableConfigServer , 这个注解是焦点 , 经由过程这个注解就可以加载设置装备摆设文件 , 建立spring cloud config server

spring cloud config server搭建本地配置系统



4点窜application.properties设置装备摆设文件 , 添加读取当地设置装备摆设文件设置 , 默认是读取git仓库的设置装备摆设文件 , 代码如下
spring.profiles.active=native
spring.cloud.config.server.native.searchLocations = classpath:/

spring cloud config server搭建本地配置系统



5为了掩饰结果 , 当作功搭建spring cloud config server , 默认有良多格局 , 这里利用{name}-{profiles}.properties格局建立一个设置装备摆设文件

spring cloud config server搭建本地配置系统



6【spring cloud config server搭建本地配置系统】拜候浏览器 , 读取适才设置装备摆设的test-dev.properties文件 , 如下图所示 , 浏览器当作功领受到当前设置装备摆设文件 , 申明config server设置装备摆设当作功

spring cloud config server搭建本地配置系统



注重事项spring cloud config server
感激点赞

以上内容就是spring cloud config server搭建本地配置系统的内容啦 , 希望对你有所帮助哦!

猜你喜欢