application-xx配置文件中配置
spring.profiles.active=${ENV}
運行環境的配置:Run/Debug Configurations中指定ENV值
測試類中的配置:@ActiveProfiles
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("dev")
public class DemoApplicationTests {
}
application-xx配置文件中配置
spring.profiles.active=${ENV}
運行環境的配置:Run/Debug Configurations中指定ENV值
測試類中的配置:@ActiveProfiles
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("dev")
public class DemoApplicationTests {
}
Spring boot 配置數據源 spring: mvc: favicon: enabled: false datasource: primary: username: root