使用application.ym进行多环境配置

1.配置激活选项

spring:
profiles:
active: dev

2.在配置文件添加若干个英文状态下的短横线即可区分

spring:
profiles:
active: dev
server:
port : 8080
servlet:
context-path: /demo name : hello demo
---
spring:
profiles: dev
server:
port : 8082
servlet:
context-path: /demo2
name : hello demo dev
---
spring:
profiles: pro
server:
port : 8083
servlet:
context-path: /demo3
name : hello demo pro
---
spring:
profiles: test
server:
port : 8084
servlet:
context-path: /demo4
name : hello demo test

运行测试

修改激活配置

spring:
profiles:
active: test

测试

Spring Boot 使用IntelliJ IDEA创建一个web开发实例(五)的更多相关文章

  1. Spring Boot 使用IntelliJ IDEA创建一个web开发实例(一)

    .新建项目File-->New-->Project-->Spring Initializr 点击Finish,一个Spring Boot web应用就创建好了.

  2. Spring Boot 使用IntelliJ IDEA创建一个web开发实例(二)

    1. 创建一个Controller类 package com.example.demo; import org.springframework.web.bind.annotation.RequestM ...

  3. Spring Boot 使用IntelliJ IDEA创建一个web开发实例(四)

    多环境配置 1. 在springBoot多环境配置文件名需要满足application-{profile}.properties的格式,其中{profile}对应你的环境标识,例如: (1)appli ...

  4. Spring Boot 使用IntelliJ IDEA创建一个web开发实例(三)

    属性配置 1.配置application.properties文件 配置web访问端口和context path server.port = 8081 server.servlet.context-p ...

  5. Intellij Idea 创建一个Web项目

    今天想用IDEA创建一个web项目: 准备工具 1.jdk1.7 2.tomcat6.0,由于下载的8.5没有lib目录不能配置改6.0 3.idea2019.1.2 Intellij Idea的安装 ...

  6. Spring MVC 学习笔记2 - 利用Spring Tool Suite创建一个web 项目

    Spring MVC 学习笔记2 - 利用Spring Tool Suite创建一个web 项目 Spring Tool Suite 是一个带有全套的Spring相关支持功能的Eclipse插件包. ...

  7. Spring Boot 多模块项目创建与配置 (一) (转)

    Spring Boot 多模块项目创建与配置 (一) 最近在负责的是一个比较复杂项目,模块很多,代码中的二级模块就有9个,部分二级模块下面还分了多个模块.代码中的多模块是用maven管理的,每个模块都 ...

  8. Spring Boot 多模块项目创建与配置 (一)

    最近在负责的是一个比较复杂项目,模块很多,代码中的二级模块就有9个,部分二级模块下面还分了多个模块.代码中的多模块是用maven管理的,每个模块都使用spring boot框架.之前有零零散散学过一些 ...

  9. Spring Boot 多模块项目创建与配置 (转)

    转载:https://www.cnblogs.com/MaxElephant/p/8205234.html 最近在负责的是一个比较复杂项目,模块很多,代码中的二级模块就有9个,部分二级模块下面还分了多 ...

随机推荐

  1. Weka平台学习

    链接:http://www.cs.waikato.ac.nz/ml/weka/index.html 一简介: WEKA的全名是怀卡托智能分析环境(Waikato Environment for Kno ...

  2. C++内存布局(1)-让new出的两个变量在堆上的地址连续

    大家都知道栈的地址按照从高到低的顺序增长的, 而堆的地址是按照从底到高的顺序增长的. ); ); cout<<"n1,n2所指的地址:" << n1 < ...

  3. 在虚拟机中安装Ubuntu详细过程

    参考:http://blog.csdn.net/u013142781/article/details/50529030

  4. 【第十周】final预发布视频

    final版本发布视频组名: 新蜂组长: 武志远组员: 宫成荣 谢孝淼 杨柳 李峤项目名称:java俄罗斯方块NEO平台:优酷地址:http://v.youku.com/v_show/id_XMTg0 ...

  5. 如何快速地编写和运行一个属于自己的 MapReduce 例子程序

    大数据的时代, 到处张嘴闭嘴都是Hadoop, MapReduce, 不跟上时代怎么行? 可是对一个hadoop的新手, 写一个属于自己的MapReduce程序还是小有点难度的, 需要建立一个mave ...

  6. PHP-时间函数

    1.时间格式化函数date(format,timestamp) format 时间格式 timestamp 时间戳 下面列出了一些常用于日期的字符: d - 表示月里的某天(01-31) m - 表示 ...

  7. SQLSERVER 使用XP开头的系统默认存储过程

    1. 根据官网上面的内容进行执行命令 EXEC xp_cmdshell 'dir *.exe'; 但是会报错 消息 ,级别 ,状态 ,过程 xp_cmdshell,行 [批起始行 ] SQL Serv ...

  8. Java 文件下载功能 解决中文乱码

    Html部分 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <ti ...

  9. C 语言assert使用

    1.assert宏的原型定义在<assert.h>中,其作用是如果它的条件返回错误,则终止程序执行,原型定义:#include <assert.h>void assert( i ...

  10. P4101 [HEOI2014]人人尽说江南好

    题目描述 小 Z 是一个不折不扣的 ZRP(Zealot Round-game Player,回合制游戏狂热玩家),最近他 想起了小时候在江南玩过的一个游戏. 在过去,人们是要边玩游戏边填词的,比如这 ...