改变springboot属性文件分隔符
If you inherit from the spring-boot-starter-parent POM, the default filter token of the maven-resources-plugins has been changed from ${*} to @ (that is, @aaa@qq.com instead of ${maven.token}) to prevent conflicts with Spring-style placeholders. If you have enabled Maven filtering for the application.properties directly, you may want to also change the default filter token to use other delimiters.
如果引入spring-boot-starter-parent,默认需要使用 @****@
如果不引入spring-boot-starter-parent,You also need to include the following element inside <plugins/>:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
The useDefaultDelimiters property is important if you use standard Spring placeholders (such as ${placeholder}) in your configuration. If that property is not set to false, these may be expanded by the build
server.port=${port:8080}
解决方案:
1:将application.properties中的占位符由${key} -> @aaa@qq.com
2:覆盖springboot的默认规则
3:测试了再自己的pom中不增加resource配置,只是增加
作者:0爱上1
链接:https://www.jianshu.com/p/929b9aa70dc8
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
上一篇: mysql分隔符转行
下一篇: Android 面试集锦