study/Spring boot
스프링 부트의 전반적인 설정을 하는 파일 application.yml
올스왑
2021. 3. 23. 19:30
스프링부트에서는 src/main/resources/application.yml 파일에 설정들을 기술한다
기존의 web.xml + root-context.xml + servlet-context.xml을 대체한다.
서버가 시작될 때 먼저 application.yml을 읽고 시작된다.
application.yml은 라이브러리에 대한 설정도 할 수 있고 서버에 대한 설정도 할 수 있다.
예를 들어 서버의 포트를 설정하거나, context-path도 설정할 수 있다.
jpa의 hibernate에서 엔티티의 변수명을 그대로 설정하기 위해서 다음과 같은 설정을 할 수 있다.
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl