spring.profiles.active 针对多种启动环境的spring配置
来源:互联网 发布:asp微信接口源码 编辑:程序博客网 时间:2024/05/17 10:26
我们的工程一般在会跑在正式环境、测试环境上,当打包或者运行的时候,切换数据库信息可能会是很麻烦的问题。
如以下配置:
spring.profiles.active=jdbcdev,certifyspring.mvc.view.prefix=/templates/spring.mvc.view.suffix=.html
配置方式:
1、在spring配置文件中配置两种环境信息
<beans profile="dev"> <context:property-placeholder location="classpath:jdbc-dev.properties"/> </beans> <beans profile="prd"> <context:property-placeholder location="classpath:jdbc-prd.properties"/> </beans>
2、在web.xml中配置使用哪种环境信息,tomcat启动的时候自动去加载对应的环境信息
<context-param> <param-name>spring.profiles.active</param-name> <param-value>dev</param-value> </context-param>
阅读全文
0 0
- spring.profiles.active 针对多种启动环境的spring配置
- spring.profiles.active 针对多种启动环境的spring配置
- spring.profiles.active 针对多种启动环境的spring配置
- spring.profiles.active配置多种spring启动环境
- spring.profiles.active
- Spring.profiles多环境配置
- spring.profiles.active=dev
- spring boot中spring.profiles.active的用法
- springboot 使用spring.profiles.active来分区配置
- Spring.profiles多环境配置原理
- Spring mvc 多种环境配置
- java编程中spring boot 使用spring.profiles.active来分区配置
- 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.active 及 @profile 注解 动态化配置内部及外部配置
- Spring boot @Test的时候需要设置 环境变量:spring.profiles.active = dev
- spring profiles实现不同的环境配置的一键切换
- 使用spring boot连接数据库出现no profiles are currently active的问题
- CentOS7 Failed to start LSB: Bring up/down networking. 已解决!!!
- 阿里云Maven仓库地址
- salt cmd.script
- 关于ActionContext.getContext()的用法心得
- Springboot 整合 Dubbo/ZooKeeper 详解 SOA 案例
- spring.profiles.active 针对多种启动环境的spring配置
- 在Homestead虚拟机上安装laravel5.5
- 学习ThreadLocal
- MFC简单的串口使用
- final、finally和finalize的区别
- jQuery-事件绑定
- RabbitMQ-JAVA常见报错信息
- Android JNI开发(6)--JNI中使用线程
- HashMap、HashTable、LinkedHashMap、TreeMap、HashSet简单总结