Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 디자인패턴 #싱글톤
- spring
- 톰캣
- Spring Framework
- 외장톰캣
- Mockito #Reflection #Sigleton #Test #JUnit
- tomcat
- LiveTemplate
- autocomplete
Archives
- Today
- Total
자라선
12. Profile 본문
@Profile
Spring Boot 는 선택하는 profile에 따라 달리 실행할 수 있다.
application.properties
spring.profiles.active=mysql
OR
java -jar <project>.jar --spring.profiles.active=oracle
application.properties 추가 및 활성화
다른 properties 파일의 내용을 추가 할 수도 있다.
이때 추가하는 properties의 네이밍 룰이 있으며 아래와 같이 작성
application-<이름>.properties
추가시 inlcude 를 사용하며 추가하는 명은 <이름> 으로 추가
application.properties
spring.profiles.include=db
활성화시 @Profile 어노테이션과 동일
application.properties
spring.profiles.active=db
OR
java -jar <project>.jar --spring.profiles.active=db
'Develop > Spring Boot' 카테고리의 다른 글
14. Test (0) | 2020.07.27 |
---|---|
13. Logging (0) | 2020.07.27 |
11. 외부설정 (0) | 2020.07.27 |
10. SpringApplication 기본 (0) | 2020.07.27 |
9. JAR 실행 및 패키징 원리 (0) | 2020.07.27 |
Comments