spring.profiles.default
来源:互联网 发布:32寸网络电视价格 编辑:程序博客网 时间:2024/06/01 07:33
摘要: 当开发环境、测试环境及生产环境需要不同的dataSource时,可以采用spring的profile定义多个数据源
1.在Spring配置文件中定义开发、测试环境和生产环境
<beans profile="test,develop"> <!-- 开发和测试环境 --></beans><beans profile="product"> <!-- 生产环境 --></beans>2.在web.xml中, 指定使用哪种环境
<context-param> <param-name>spring.profiles.default</param-name> <param-value>test</param-value></context-param>或者<servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>spring.profiles.active</param-name> <param-value>product</param-value> </init-param></servlet>或者-Dspring.profiles.active="profile1,profile2"
0 0
- spring.profiles.default
- Spring 启动时报No active profile set, falling back to default profiles default
- spring boot启动报错:No active profile set, falling back to default profiles: default
- spring profiles
- spring.profiles.active
- No active profile set, falling back to default profiles: default
- No active profile set, falling back to default profiles: default
- maven 整合 spring profiles功能
- Spring.profiles多环境配置
- spring.profiles.active=dev
- spring boot 官方文档翻译之 Profiles
- Spring.profiles多环境配置原理
- spring mvc default controller
- spring.profiles.active 针对多种启动环境的spring配置
- spring.profiles.active配置多种spring启动环境
- spring boot中spring.profiles.active的用法
- spring.profiles.active 针对多种启动环境的spring配置
- spring.profiles.active 针对多种启动环境的spring配置
- C++学习之vector重复元素的去除和求vector中最大最小元素及其索引
- MATLAB常用形态学操作函数
- CSU-1839 Who Feels Lucky(数形结合)
- font-family与font-face区别
- Hibernate之:各种主键生成策略与配置详解
- spring.profiles.default
- 关于浏览器被hao123劫持的解决办法
- oracle新增字段时提示数据类型不正确
- java操作符学习过程(四)
- Kotlin IO操作
- Mac下载码云中的项目
- js-8
- Oracle GoldenGate 之 SqlServer数据同步到Mysql数据库
- Mybatis 源码分析一、 SqlSessionFactory的创建过程