如果未设置 -Dspring.profiles.active
,我希望我的默认 Activity 配置文件为 production
。
我在 application.properties
中尝试了以下操作,但没有成功:
spring.profiles.default=production
Spring-boot 版本 = 1.3.5.RELEASE
最佳答案
您在这里所做的是将默认的 default 配置文件(如果您未指定 @Profile
注释,则在任何 bean 上使用的配置文件)为生产
.
你真正需要做的是设置默认的active配置文件,这样做是这样的:
spring.profiles.active=production
关于java - 在 Spring-boot 中设置默认 Activity 配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37700352/