사용할 수 있는 외부 설정
- properties
- YAML
- 환경 변수
- 커맨드 라인 아규먼트
프로퍼티 우선 순위
- 유저 홈 디렉토리에 있는 spring-boot-dev-tools.properties
- 테스트에 있는 @TestPropertySource
- @SpringBootTest 애노테이션의 properties 애트리뷰트
- 커맨드 라인 아규먼트
- SPRING_APPLICATION_JSON (환경 변수 또는 시스템 프로티) 에 들어있는 프로퍼티
- ServletConfig 파라미터
- ServletContext 파라미터
- java:comp/env JNDI 애트리뷰트
- System.getProperties() 자바 시스템 프로퍼티
- OS 환경 변수
- RandomValuePropertySource
- JAR 밖에 있는 특정 프로파일용 application properties 13. JAR 안에 있는 특정 프로파일용 application properties 14. JAR 밖에 있는 application properties
- JAR 안에 있는 application properties
- @PropertySource
- 기본 프로퍼티 (SpringApplication.setDefaultProperties)
'ys TIL' 카테고리의 다른 글
Spring Boot Data Jpa 사용자 정의 Repository 만들기 (0) | 2020.07.10 |
---|---|
querydsl 적용하기 (0) | 2020.07.10 |
Spring Boot test에서 H2 In memory 설정하기 (0) | 2020.06.02 |