SpringBoot entry (a)

SpringBoot profile path load

Profiles related

SpringBoot默认识别application.properties文件或者application.yml文件

Start when you can use
1, specify the configuration file

new SpringApplicationBuilder(当前类.class).properties("spring.config.location=classpath:/abc.properties).run(args);

2, the configuration in an environment designated use

new SpringApplicationBuilder(当前类.class).properties("spring.profiles.active=linux").run(args);	

Designated port

new SpringApplicationBuilder(当前类.class).properties("spring.profiles.active=linux","server.port=9999").run(args);	

About yml file syntax

In the paper, by - - - Three broken files can be divided into multiple configuration files,

About built-in properties can be found in the official documentation of SpringBoot

https://docs.spring.io/spring-boot/docs/1.5.7.RELEASE/reference/htmlsingle/#getting-started-introducing-spring-boot
目录:X. Appendices
A. Common application properties

pom-dependent files related to introduction

spring-boot-devtools quick restart

	开发的时候,当系统启动时,我们修改了代码,有了改依赖,则修改保存后系统自动重启

Reading order: priority load, and does not cover the same properties

1: config file in the project root path
2: Project root path
3: config directory to find the classPath
4: In classPath directly under the root directory.

Guess you like

Origin blog.csdn.net/m0_37668842/article/details/92066813