KL个人博客 首页>>profile

spring boot项目使用maven profile要注意了

spring boot项目使用maven profile要注意了

问题 出处 今天,一个简单的demo项目为了方便,使用了spring boot搭建,功能性上考虑不仅要使用spring boot自身的profile功能,还有结合maven的profile功能来编译时即指定环境变量?问题就出在这里了,maven的profile等都配置好了,配置文件中使用${xxx}就是引用不到profile里配置的变量! 问题定位 最后找了很久,在 spring-boot-starter-parent.pom里找到了答案,spring boot starter parent里build里resource配置如...

阅读全文 »