[스프링 입문(김영한)] #1 프로젝트 환경설정

오젼·2022년 11월 6일

프로젝트 생성

java 11설치
h2 설치
intellij 설치

라이브러리 살펴보기

spring boot에서 선택한 라이브러리가 의존하고 있는 라이브러리까지 모두 타고 타고 들어가 다운 받아온다.

intelij의 gradle 항목에서 볼 수 있음.

스프링 부트 라이브러리

spring-boot-starter-web

  • spring-boot-starter-tomcat: tomcat이 embeded로 들어가 있어 따로 서버 설정 필요 없이 톰캣 서버를 열 수 있다.
  • spring-webmvc: 스프링 웹 MVC(Model, View, Controller)

spring-boot-starter-thymeleaf: 타임리프 템플릿 엔진(View)

spring-boot-starter(공통): 스프링 부트 + 스프링 코어 + 로깅

  • spring-boot
    - spring-core
  • spring-boot-starter-loggin
    - slf4j, logback 조합 사용. 로그에 대해 궁금한 점이 있으면 두 라이브러리 검색해 볼 것.

테스트 라이브러리

spring-boot-starter-test

  • junit: 테스트 프레임워크
  • mockito: 목 라이브러리
  • assertj: 테스트 코드를 좀 더 편하게 작성하게 도와주는 라이브러리
  • spring-test: 스프링 통합 테스트 지원

View 환경설정

Welcome Page

statc/index.html을 올려두면 spring boot상에서 Welcome page 기능을 제공한다.

https://docs.spring.io/spring-boot/docs/current/reference/html/web.html#web.servlet.spring-mvc.welcome-page

thymeleaf 템플릿 엔진

0개의 댓글