1.配置文件占位符

application.properties
#person
person.name=无敌多么寂寞
person.age=${random.int}
person.bir=2018/12/11
person.boss=true
person.map.q1=1
person.map.q2=2
person.lists=a,b,c
person.dog.name=${person.name}*cat
person.dog.age=22
@Autowired
Person person;
@Test
public void contextLoads() {
System.out.println(person);
}


#person
person.name=无敌多么寂寞
person.age=${random.int}
person.bir=2018/12/11
person.boss=true
person.map.q1=1
person.map.q2=2
person.lists=a,b,c
person.dog.name=${person.mr:mr}*cat
person.dog.age=22


2.Profile

默认使用application.properties
2.2多profile文档切换模式
server:
port: 8088
spring:
profiles:
active: dev
---
server:
port: 8090
spring:
profiles:dev //指定属于那个文档库


2.3激活方式


server:
port: 8088
spring:
profiles:
active: dev
---
server:
port: 8090
spring:
profiles:dev //指定属于那个文档库


2.3.3指定激活的命令行

3.配置文件的加载位置






摘自:https://www.cnblogs.com/Mrchengs/p/10120140.html
3springboot:springboot配置文件(配置文件占位符、Profile、配置文件的加载位置)
原文:https://www.cnblogs.com/lyh233/p/12489352.html