我正在尝试使用 Maven3在 SpringBoot 应用程序中设置一个活动配置文件。
在 pom.xml 中,我将 默认活动配置文件和属性 Spring.profile 激活设置为 发展:
<profiles>
<profile>
<id>development</id>
<properties>
<spring.profiles.active>development</spring.profiles.active>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
但是每次运行我的应用程序时,我都会在日志中收到以下消息:
No active profile set, falling back to default profiles: default
SpringBoot 配置文件被设置为 default (读取 application.properties 而不是 application-development. properties)
要使用 Maven 配置文件设置 SpringBoot 活动配置文件,我还应该做些什么?
非常感谢你的帮助。