Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spring:
host: smtp.gmail.com
port: 587
username: ${MAIL_USERNAME:whereg87@gmail.com}
password: ${MAIL_PASSWORD:}
password: ${MAIL_PASSWORD}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

${MAIL_PASSWORD}와 같이 기본값 없이 플레이스홀더를 정의하면, 로컬 개발 환경이나 빌드/테스트 환경 등에서 MAIL_PASSWORD 환경 변수가 설정되어 있지 않을 경우 애플리케이션 구동 시 IllegalArgumentException (Could not resolve placeholder) 에러가 발생하며 기동에 실패하게 됩니다.\n\n로컬 환경에서 메일 기능이 필수적이지 않더라도 애플리케이션이 정상적으로 실행될 수 있도록 기존처럼 빈 문자열이라도 기본값(:)을 지정해 두는 것을 권장합니다.

    password: ${MAIL_PASSWORD:}

properties:
mail:
smtp:
Expand Down
Loading