스프링부트 프로젝트 생성하는 방법
그레이들 설정 파일인 build.gradle 수정하기
① plugins 블럭
-> org.springframework.boot(프로젝트에 사용할 플러그인인 스프링 부트 플러그인)
-> spring.dependency-management(스프링의 의존성을 자동으로 관리)
② repositories 블럭 : 의존성을 받을 저장소
③ dependencies 블럭 : 프로젝트를 개발하면서 필요한 기능의 의존성을 입력
-> spring-boot-starter-web(기본값을 모두 지우고 웹 관련 기능 제공)
-> spring-boot-starter-test(테스트 기능 제공)
plugins { id 'java' id 'org.springframework.boot' version '3.1.0' id 'io.spring.dependency-management' version '1.1.0' } group = 'com.sparta' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '17' } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } dependencies { // Security implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' } tasks.named('test') { useJUnitPlatform() }