springcloud读取git上的配置文件
来源:互联网 发布:广西大学网络教育 编辑:程序博客网 时间:2024/06/01 09:52
如何在springboot项目启动的时候加载指定的git上的配置文件呢?
1、JVM参数方式:
tomcat 中 catalina.bat(.sh中不用“set”) 添加JAVA_OPS。通过设置active选择不同配置文件
set JAVA_OPTS="-Dspring.profiles.active=test"
eclipse 中启动tomcat。项目右键 run as –> run configuration–>Arguments–> VM arguments中添加。local配置文件不必上传git追踪管理
-Dspring.profiles.active="local"
2、web.xml方式:
<init-param> <param-name>spring.profiles.active</param-name> <param-value>production</param-value></init-param>
3、标注方式(junit单元测试非常实用):@ActiveProfiles({"unittest","productprofile"})
阅读全文
0 0
- springcloud读取git上的配置文件
- git配置文件读取顺序
- Spring+Junit 读取WEB-INF上的配置文件
- springcloud config 访问配置文件
- SpringCloud-----SpringCloud命令行参数不能覆盖远程配置文件设置的参数
- 读取配置文件的类
- 配置文件的读取
- 配置文件的读取(.config)
- 配置文件的读取
- JDBC配置文件的读取
- 数据库配置文件的读取
- JAVA [ 配置文件的读取 ]
- 配置文件的读取
- openstack 配置文件的读取
- 配置文件读取的使用
- JDBC配置文件的读取
- openstack 配置文件的读取
- 配置文件的读取
- 第三方登录 验证码 日夜间模式
- 图片样式,辅助类样式
- Spring(13)——PropertyPlaceholderConfigurer
- iOS UIGestureRecognizer(手势操作)~demo
- 一个简单的爬虫程序(爬取百度百科关于python的一千个页面)
- springcloud读取git上的配置文件
- Django models中的meta选项
- hdu6055_Regular polygon_暴力枚举
- 笨方法学Python 习题 18: 命名、变量、代码、函数
- 版本管理工具Git相关知识及其注意事项
- 从源码角度理解postInvalidate和Invalidate
- C++基础,名字空间、C++函数重载的实现原理
- fragment复用==
- Oracle TRUNCATE语法