spring-boot 의존성을 위한 build.gradle 파일 내의 기본적인 용어에 대해 정리한다.
- 플러그인 의존성 관리를 위한 설정
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
buildscript {
ext {
springBootVersion = '2.5.2'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:
spring-boot-gradle-plugin:${springBootVersion}")
}
}
plugins {
id 'java'
}
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'eclipse'
group 'com.example.smspring'
version '1.0-SNAPSHOT'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
|
cs |
줄 | 용어 | 내용 |
2 | ext | build.gradle에서 사용하는 전역 변수 선언 |
19 | io.spring.dependency-management | 스프링 부트 의존성 관리 플러그인 반드시 추가해야한다 |
26 | repositories | 의존성을 다운받을 저장소명 jcenter()는 deprecated 되었으므로 mavenCentral만 사용하도록 한다 |
31 | implementation | gradle 7 이상 버전에서는 compile 대신 implementation 을 사용한다 스프링 부트 관련 의존성 버전을 명시하지 않으면 3줄의 버전을 따른다 |
'Spring > 개념' 카테고리의 다른 글
IoC 제어의 역전 (0) | 2022.04.14 |
---|---|
JPA Auditing 이란? (0) | 2022.01.14 |