properties和yaml 文件加载指定配置文件的注解
加载指定配置文件的注解:
@PropertySource (value = "classpath:xx.properties")
使用yaml文件的加载配置的注解,将实体对象和配置文件关联
@ConfigurationProperties(prefix="xxx")
yaml使用需要添加的依赖:配置文件处理器,方便编写配置文件
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>