• Home
  • About
    • lahuman photo

      lahuman

      열심히 사는 아저씨

    • Learn More
    • Facebook
    • LinkedIn
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

spring boot jar 파일 실행시 application.yml 주입 하기

03 Apr 2024

Reading time ~1 minute

spring boot 실행시 설정 파일 외부 주입 방법

실행 명령어를 이용한 주입

$ java -jar app.jar --spring.config.location=file:///Users/home/config/jdbc.properties

디렉토리 기반 주입

$ java -jar app.jar --spring.config.name=application,jdbc --spring.config.location=file:///Users/home/config

마치며

다른 여러가지 방법이 있지만 위의 2가지 방법으로 대부분 처리가 가능합니다.

참고자료

  • Spring Properties File Outside jar


springbootjarconfig Share Tweet +1