SpringBoot 프로젝트 생성하기

Eojin·2023년 6월 20일
0

스프링부트 프로젝트 생성하는 방법
그레이들 설정 파일인 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()
}
profile
'함께'가 즐거운 개발 공부하는 사람입니다.

0개의 댓글

관련 채용 정보