spring_reference/IV. Spring Boot features/24.2. Programmatically sett...

4 lines
255 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 24.2.以编程方式设置profiles
在应用运行前你可以通过调用SpringApplication.setAdditionalProfiles(…)方法以编程的方式设置生效的配置。使用Spring的ConfigurableEnvironment接口激动配置也是可行的。