Spring boot 의존성을 받아오기 위해서는 2가지 방법이있다.
<parent>를 이용하는 방법과 <dependencyManagement>를 이용하는 방법니다.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.5.RELEASE</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.5.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
언뜻보면 같은것같지만 확실한 차이점이 있다.
<parent>를 사용하게된다면 필요한 dependency들을 가지고오는것 뿐만아니라 java버전을 1.8로 기본세팅 인코딩방식을 UTF-8로 세팅 리소스들을 읽는기능등 다양한기능을한다.
자세한기능은 여기에서 확인가능하다.
반면에 <dependencyManagement>는 parent의 다양한기능은 제외하고 dependencyManagement기능만 수행하게 된다.
Spring Boot Reference Documentation
This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe
docs.spring.io
https://www.inflearn.com/course/%EC%8A%A4%ED%94%84%EB%A7%81%EB%B6%80%ED%8A%B8/dashboard
인프런 - 로그인이 필요합니다
지식공유자 되기 많은 사람들에게 배움의 기회를 주고, 경제적 보상을 받아보세요. 지식공유참여
www.inflearn.com
'개발 > Spring' 카테고리의 다른 글
[Spring]class java.lang.String cannot be cast to class org.springframework.security.core.userdetails.User (0) | 2020.03.15 |
---|---|
[Spring] Spring boot란 무엇인가 ? (0) | 2020.03.04 |
[Spring] Spring Security 알아보기 (0) | 2020.03.03 |
[Spring Boot] Spring Boot의 의존성 원리와 @SpringBootApplication (0) | 2020.03.03 |
[Querydsl] Dto Q파일 만들기 (0) | 2020.02.29 |
댓글