天天看点

Spring Boot 加载properties配置文件

PropertySource和Configuration一起使用,以下是API中的解释

Annotation providing a convenient and declarative mechanism for adding a PropertySource to Spring's Environment. To be used in conjunction with @Configuration classes.(为把属性资源添加到Spring的环境变量中提供一种便捷的声明机制,要配合Configuration注解一起使用)

以下是测试类