application.properties (2) 썸네일형 리스트형 [Spring Boot] 프로파일 1. 프로파일 Spring Framework에서 제공해주는 기능 특정한 Profile에서만 특정한 Bean을 등록하고 싶다거나 어플리케이션의 동작을 특정 Profile에서만 다르게 하고 싶을 때 사용 # Profile("prod") @Profile("prod") @Configuration public class BaseConfiguration { @Bean public String hello() { return "hello"; } } -> 이 Bean 설정파일 자체가 "prod" 라는 profile일 때 사용이 됨 # HumanRunner @Component public class HumanRunner implements ApplicationRunner { @Autowired private String .. [Spring Boot] 외부 설정 1. 외부 설정 어플리케이션에서 사용할 여러 설정 값들을 어플리케이션의 밖이나 안에 정의할 수 있는 기능 ex) application.properties : Spring Boot가 어플리케이션을 구동할 때 자동으로 로딩하는 파일 ① src/main/resources/application.properties key-value 형태로 정의하면 어플리케이션에서 참조해서 사용할 수 있음 ② 사용 예제 -> 우선순위 15위 import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; .. 이전 1 다음