@PropertySource1 [Spring Annotation] @PropertySrouce @PropertySourceSping에서 제공하는 Annotaion으로 .properties 파일의 데이터를 key=value쌍을 읽어 올 수 있습니다.specialcustomer.dicount=0.1summer.discount=0.15endofyear.discount=0.2 아래의 예시를 보겠습니다. 기본적인 application.properties의 파일 내용을 가져오지 않고, 특정 파일 discounts.properties 파일 내용을 가져 오려면 @PropertySource에 선언해서 해당 파일을 가져 오면 됩니다. @Value를 사용함으로써 해당 파일에 명시된 key=value=를 불러옵니다.@Configuration@PropertySource("classpath:discounts.propert.. FrameWorks/Spring & Boot 2025. 1. 12. 이전 1 다음 728x90 반응형