Tag: yaml

Spring Boot:如何使用多个yml文件

在Spring Boot中,我知道我可以用application.yml替换application.properties并使用YAML格式。 但是,我的application.yml越来越拥挤,所以我需要把它分开一点。 我怎样才能做到这一点? 我想做这样的事情: … @Configuration @EnableAutoConfiguration @EnableWebMvc @EnableScheduling @PropertySource({“classpath:application.yml”, “classpath:scheduling.yml”}) public class ApplicationConfig { …

从Java中的yaml读取地图获取null

使用spring,我在通过java阅读我的yaml时遇到了问题。 让我先说明代码 @Component @EnableConfigurationProperties @ConfigurationProperties(prefix = “countries”) public class UserLimitReader { private HashMap orders; private HashMap requests; public HashMap getOrders() { return orders; } public void setOrderRedeemableLimit(HashMap orders) { this.orders= orders; } public HashMap getRequests() { return requests; } public void setMonthlyRedeemableLimit(HashMap requests) { this.requests= requests; } } 我的yaml文件: cassandra: hosts: localhost:9142, 127.0.0.1:9142 keyspace: test […]