Solve the problem that the pom.xml environment configuration in the Spring Boot project takes effect after packaging, but the idea version does not work

In the multi-environment configuration through maven in Spring Boot above , we configured the environment selection through pom.xml
, but this only takes effect in the packaged jar. It is indeed a bit problematic to start this thing directly through the idea.

In fact, let's execute compile, manually compile it
insert image description here
, and then restart it.
insert image description here
It is obvious that our configuration here has taken effect.

This means that every time we change the pom.xml environment configuration, we have to manually execute compile and let him recompile.

Guess you like

Origin blog.csdn.net/weixin_45966674/article/details/132527011