SpringBoot多环境区分
1、修改application.yml配置文件
spring:
profiles:
active: cppdy
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/test?characterEncoding=UTF-8
username: root
password: root
thymeleaf:
mode: HTML5
encoding: UTF-8
content-type: text/html
name: cppdy123
2、创建application-cppdy.yml配置文件
name: cppdy222
3、访问测试方法读取的是application-cppdy.yml中的name值
SpringBoot多环境区分的更多相关文章
- SpringBoot学习笔记(八):SpringBoot启动端口+访问路、SpringBoot配置文件yml、SpringBoot多环境区分、SpringBoot打包发布
SpringBoot启动端口+访问路径 配置文件: server.port=9090 server.context-path=/springboot 现在只能用http://127.0.0.1:909 ...
- springboot 不同环境不同的配置
前言 我们在开发Spring Boot应用时,通常同一套程序会被应用和安装到几个不同的环境,比如:开发.测试.生产等.其中每个环境的数据库地址.服务器端口等等配置都会不同,如果在为不同环境打包时都要频 ...
- spring-boot 根据环境启动
spring-boot 根据环境启动: java -jar spring-boot--config--SNAPSHOT.jar --spring.profiles.active=prod
- SpringBoot 多环境配置
转载:https://www.cnblogs.com/gdpuzxs/p/7191436.html 在我们的实际开发中,一般都有三套环境,开发环境,测试环境,生产环境,三套环境的数据库连接配置也有所不 ...
- springboot 多环境配置yml或properties
https://www.cnblogs.com/mr-yang-localhost/p/8971327.html springboot 多环境配置 https://blog.csdn.net/li ...
- spring-boot多环境配置文件
spring-boot多环境配置文件 目录 配置 多环境配置文件名称要遵循格式 application-{profile}.yml application.yml spring: profiles: ...
- springboot多环境配置
springboot多环境(dev.test.prod)配置 2017-07-17 10:33 1290人阅读 评论(0) 收藏 举报 分类: spring boot(6) 版权声明:本文为博主原 ...
- 我的spring-boot开发环境
我的spring-boot开发环境,目的方便我快速搭建开发环境,同时可以最佳实践.使用spring-boot 2.1.x. 代码地址:GitHub my-springboot-examples 目的是 ...
- springboot 多环境
springboot 多环境 --spring.profiles.active=dev 查看 Ioc 容器 PostProcessorRegistrationDelegate
随机推荐
- linux随机生成密码
1.mkpassword工具 # 使用最多的密码生成工具 yum -y install expect #需要安装expect工具 mkpasswd -l -d -c -C -s #直接在命令行进行随机 ...
- 快速安装nginx
1.创建nignx用户 /usr/sbin/groupadd -f nginx /usr/sbin/useradd -g nginx nginx 2.安装依赖 yum install gcc gcc- ...
- modbus 寄存器介绍
modbus 的查询命令 命令 地址开始(两个地址) 地址长度(两个地址) 检验 01 xx xx xx ...
- 【blog】谷歌浏览器如何设置编码
解释 55.0.2883.75 版本之后的chrome的更多工具菜单项里就没有编码设置了,理由据说是使用率比较低,促进网页编码规范.google 真是脑抽了,普通用户也许很少遇到默认编码错误显示出现乱 ...
- #6278. 数列分块入门 2(询问区间内小于某个值 xx 的元素个数)
题目链接:https://loj.ac/problem/6278 题目大意:中文题目 具体思路:数列分块模板题,对于更新的时候,我们通过一个辅助数组来进行,对于原始的数组,我们只是用来加减,然后这个辅 ...
- scrapy基本使用(二)
scrapy基本使用(二) 参考链接: http://scrapy-chs.readthedocs.io/zh_CN/0.24/intro/tutorial.html#id5 scrapy基本使用(一 ...
- 前端-----html(1)
基本结构 Doctype Doctype告诉浏览器使用什么样的html或xhtml规范来解析html文档 <!DOCTYPE html> bead标签 Meta 提供有关页面的元信息,例: ...
- WINDOWS系统中常用网络命令及命令实例详解
一.查询DNS.IP,mac地址及DHCP服务的情况 二.查看ARP表:MAC地址与IP地址的映射表 三.查看共享资源 四.查看局域网内的主机名 五.查看用户列表 六.路由跟踪命令 七.查看共享资源 ...
- strstr()函数的使用
strstr(str1,str2) 函数用于判断字符串str2是否是str1的子串.如果是,则该函数返回str2在str1中首次出现的地址:否则,返回NULL. 实例: /** *Descriptio ...
- linux 常用的中文手册
http://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.html 总结的非常好!包括基础.进阶以及各种常用工具.