springboot# 프로필 처리
2. bean을 통해 관련 속성 집합
1. 시작 클래스에서 다음과 같은 설명을 통해 사용자 정의 속성 파일을 불러올 수 있습니다
@PropertySource(value = {"classpath:proName.properties"},encoding = "utf-8")
@PropertySource(value = {"classpath:/config/system.properties"},encoding = "utf-8")
@Value("${xxx.xxx.xxx: }")
2. 프로필을 여러 프로필에 배치하는 것이 프로필의 결합을 풀기 위해서라면 같은 종류의 프로필을 사용자 정의 bean에 넣는 것이 프로필의 집합이다
# system.properties
system.name=xxx
system.upload-path=/opt/app/upload
@Component
@ConfigurationProperties(prefix="system")
@PropertySource("classpath:system.properties")
@Getter
@Setter
@ToString
public class SystemConfig{
private name = "default app name";
private uploadPath = "/tmp/default";
}