spring: profiles: active: dev
server: port: 8081
server: port: 8082
server: port: 8083
server: port: 8084
启动:
active: dev
<profiles> <!-- 开发环境--> <profile> <id>dev</id> <properties> <spring.profiles.active>dev</spring.profiles.active> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <!-- 测试环境--> <profile> <id>test</id> <properties> <spring.profiles.active>test</spring.profiles.active> </properties> </profile> <!-- 预发布环境--> <profile> <id>uat</id> <properties> <spring.profiles.active>uat</spring.profiles.active> </properties> </profile> <!-- 线上环境--> <profile> <id>prod</id> <properties> <spring.profiles.active>prod</spring.profiles.active> </properties> </profile> </profiles>