leelee.log
(팁-스프링) @Profile과 @ActiveProfiles의 차이 본문
http://wonwoo.ml/index.php/post/1933
@Profile 과 @ActiveProfiles
오늘은 Spring의 @Profile 어노테이션과 @ActiveProfiles 어노테이션에 대해서 알아보도록 하자. 가끔 헷갈리는 개발자분들이 있으니 다시 한번 짚고 넘어 가면 좋을 듯하다. @Profile @Profile 어노테이션은 굉장히 유용한 어노테이션이다. 각 환경에 맞게 Spring의 Bean들을 올릴 수 있어 아주 자주 사용되는 어노테이션…
wonwoo.ml
@Profile과 @ActiveProfiles 둘 다 application.properties 파일들에 따라서 Spring Bean을 만드는데 (개발환경과 배포환경을 구분지어줄 수 있다는 뜻) @Profile은 SpringBootApplication을 진짜 실행할 때 사용하는거고 @ActiveProfiles는 테스트를 할 때 사용한다.
'읽어볼 자료 아카이빙' 카테고리의 다른 글
(팁-리눅스) su, su -, sudo 차이 (0) | 2020.03.17 |
---|---|
(팁-리눅스) vmware에 설치된 ubuntu에 wi-fi 연결하기 (0) | 2020.03.13 |
(팁-git)remote branch local에 가져오는 방법 (0) | 2020.03.12 |
(팁-프론트)javascript를 jetbrain 툴로 디버깅 하는 방법 (0) | 2020.03.01 |
(팁-스프링) Junit5 테스트 환경- 기본세팅, Mockmvc, Mock, (0) | 2020.02.09 |