Spring Boot中application.properties文件中以下两条语句有什么区别

Ric*_*ews 3 java spring spring-boot application.properties

Spring Boot中application.properties文件中的以下两条语句有什么区别?

server.port = 8080 和 server.port = ${PORT:8080}

请帮忙解释一下

Jis*_*hap 5

  1. server.port = ${PORT:8080}将检查环境变量PORT并获取其值,如果不存在则默认为8080
  2. server.port =8080一直会8080