Files
spring-boot-examples/docs/91_dependencies.md
2025-04-08 19:56:24 +09:00

5.8 KiB

스프링 부트(Spring Boot)는 다양한 기능을 제공하기 위해 여러 가지 **의존성 패키지(스타터)**를 사용합니다. 이 스타터들은 특정 기능 구현에 필요한 라이브러리들을 묶어서 제공하는 일종의 **"기능 모듈 번들"**입니다.
아래는 주요한 Spring Boot 의존성 패키지 목록각각의 기능 설명입니다.


핵심(Spring Boot Core)

의존성 패키지 설명
spring-boot-starter 스프링 부트의 기본 핵심 기능 제공 (로깅, 자동 설정 등)
spring-boot-starter-parent Maven 프로젝트의 부모로 사용. 버전 관리, 플러그인, 의존성 정리 지원
spring-boot-starter-test JUnit, Mockito, Spring Test 등 포함된 테스트 전용 스타터

🌐 웹 개발

의존성 패키지 설명
spring-boot-starter-web Spring MVC, Tomcat(기본), REST API 작성용 핵심 스타터
spring-boot-starter-webflux 비동기 웹 개발을 위한 WebFlux 지원 (Reactor 기반)
spring-boot-starter-thymeleaf Thymeleaf 템플릿 엔진 사용 (서버 사이드 렌더링 HTML)
spring-boot-starter-mustache Mustache 템플릿 엔진 지원
spring-boot-starter-freemarker FreeMarker 템플릿 엔진 지원
spring-boot-starter-undertow 톰캣 대신 Undertow 사용
spring-boot-starter-jetty 톰캣 대신 Jetty 사용

🗄️ 데이터베이스 & JPA

의존성 패키지 설명
spring-boot-starter-data-jpa JPA, Hibernate 기반 ORM 지원
spring-boot-starter-data-jdbc JDBC 직접 접근용. ORM 없이 SQL 중심 개발
spring-boot-starter-jdbc 순수 JDBC 개발용. 트랜잭션, DataSource 등 포함
spring-boot-starter-data-mongodb MongoDB 연동 (Spring Data MongoDB)
spring-boot-starter-data-redis Redis 연동 (Spring Data Redis)
spring-boot-starter-data-elasticsearch Elasticsearch 연동
spring-boot-starter-batch Spring Batch 기반 대용량 배치 처리
spring-boot-starter-quartz Quartz 스케줄링 엔진 연동

🔐 보안 & 인증

의존성 패키지 설명
spring-boot-starter-security Spring Security 기반의 인증, 인가 시스템 지원
spring-boot-starter-oauth2-client OAuth2 인증 클라이언트용
spring-boot-starter-oauth2-resource-server 리소스 서버 기능 제공 (JWT 등)

📨 메시징 & 통신

의존성 패키지 설명
spring-boot-starter-mail SMTP 메일 전송 기능 지원
spring-boot-starter-amqp RabbitMQ 연동 (Spring AMQP)
spring-boot-starter-artemis ActiveMQ Artemis 연동
spring-boot-starter-integration Spring Integration 기반 시스템 통합
spring-boot-starter-websocket 웹소켓 실시간 통신 기능 제공

🛠️ 개발 편의성

의존성 패키지 설명
spring-boot-devtools 자동 리로드, 빠른 개발을 위한 도구
spring-boot-configuration-processor application.properties 또는 application.yml 자동 완성 지원
spring-boot-starter-actuator 서버 상태, 메트릭, 헬스체크, 모니터링 기능 제공 (/actuator 엔드포인트)

🧪 테스트

의존성 패키지 설명
spring-boot-starter-test JUnit5, Mockito, AssertJ, Spring Test 포함 (모든 테스트에 기본 사용)

🗂️ 추가 도구 (선택적)

의존성 패키지 설명
spring-boot-starter-validation Bean Validation (JSR-380, Hibernate Validator 포함)
spring-boot-starter-logging SLF4J + Logback 기반 로깅 설정 (기본 내장)
spring-boot-starter-json Jackson 기반 JSON 직렬화/역직렬화 기능
spring-boot-starter-cache Spring Cache abstraction 지원
spring-boot-starter-aop AOP 기능 지원 (AspectJ 등 포함)

🎯 예시: 일반적인 웹 애플리케이션

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'     // 웹 MVC
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'// ORM
    implementation 'org.springframework.boot:spring-boot-starter-security'// 보안
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' // 템플릿
    implementation 'com.mysql:mysql-connector-j' // MySQL JDBC 드라이버

    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

🧾 마무리

스프링 부트의 스타터 패키지는 복잡한 의존성 관리를 간소화하고, 빠른 애플리케이션 개발을 가능하게 해줍니다. 필요에 따라 스타터를 조합하여 자신만의 맞춤형 프로젝트를 구성할 수 있으며, 대부분의 기능은 **자동 설정(Auto Configuration)**으로 바로 사용할 수 있다는 것이 큰 장점입니다.


원하신다면 "어떤 조합이 어떤 상황에 적절한지" 또는 "실무에서 자주 쓰는 조합 베스트 5" 같은 응용도 정리해드릴 수 있어요!