Springboot uses maven multi-environment deployment issues?

is that I use springboot in maven for multi-environment configuration when I found a problem, when using maven filter, in the custom properties file can use wildcards to read the values in the application.properties file, but not to read yml, there is a boss know why, can be solved.

the above picture takes the value in application.properties, but if you change the resource to yml, you can"t get it

.
May.26,2021

feels that your opening method is not quite right. The, maven filter mechanism is to replace @ key@ with the value of the profile file when maven is dealing with the resource file. This is the behavior of maven, and profile reads the properties file.
spring-boot itself also provides a set of environment management:
for example, the environment is divided into
application-dev.properties or application-dev.yml
application-product.properties or application-product.yml
configuration information of each environment is configured separately
identify the environment by spring.profiles.active=dev | product at startup

Menu