profile is mainly to solve the problems of different variables and configurations required by different environments.
profile generally appears in two places: settings.xml, pom.xml
In settings.xml, it is generally used for warehouse selection (only aliyun warehouses can configure settings.xml in this way)
In pom.xml, it is generally used to activate the environment configuration
<profiles>
<profile>
<id>local</id>
<properties>
<profiles.active>local</profiles.active>
</properties>
</profile>
<profile>
<id>elk</id>
<properties>
<profiles.active>elk</profiles.active>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
The build code used in conjunction with profile packaging is configured as follows (combined with the application-${env}.properties file)
Part of application-${env}.properties
application-prepub.properties 中 spring.profiles.active=prepub-qa
application-daily.properties 中 spring.profiles.active=daily
application.properties 中 spring.profiles.active=@env@