spring boot 读取配置文件
通过@ConfigurationProperties方式
```java 读取配置文件 import lombok.Getter; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component;
@Component @ConfigurationProperties(prefix = "bill") public class BillActivitiConfig {
}
ConfigurationProperties 注解需要添加依赖
```xml pom.xml
org.springframework.boot spring-boot-configuration-processor true ```
Last updated