簡體   English   中英

如何在spring boot中設置環境

[英]How to Environment setup in spring boot

我想在我的 Spring Boot 應用程序中設置環境,如生產或開發。 我必須根據環境使用不同的數據源。 那么在spring boot中正確的方法是什么?

你應該看看簡介。

@Configuration
@Profile("production")
public class ProductionConfiguration {

    // ...

}

http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM