The normal situation is first loaded yml, the next load properties file. If the two are present in the same configuration file. Finally, use the properties in the configuration. Finally, read the highest priority set.
Port number two in the configuration file is not the same reads the port number of properties.
I configured in application.properties file:
server.port=8085
In the configuration file application.yml:
server:
port: 8086
Start the project, the console output:
main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8085 (http)
Fully illustrates this point.
Reprinted from https://blog.csdn.net/wangmx1993328/article/details/81005170