Original Post Address: http://www.cnblogs.com/softidea/p/5644755.html
I was in the maven pom file in a multi-environment variable configuration, quotes maven-resources-plugin, specify the configuration file under different circumstances in application.properties by the following configuration file,
spring.profiles.active = ${profiles.active}
However, $ {profiles.active} variable value can not be obtained from alternative pom file. It is a problem for a long time, finally found the root of the problem in the original bloggers article.
The original blogger quoted saying:
Because of
${}
the way will be processed maven. If you pom inheritedspring-boot-starter-parent
, the Spring
the Boot has maven-resources-plugins default${}
mode to a@@
mode, such as@name@
If you want to continue using $ {} placeholder embodiment, only need to add the following configuration file in pom:
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>utf-8</encoding>
<useDefaultDelimiters>true</useDefaultDelimiters>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>