스프링부트

스프링부트 gradle 설정

똥태 2022. 7. 31. 19:05

build.gradle 을 다음과 같이 설정하니 exception 발생

원인: gralde 7 버전에서는 compile -> implementation 으로 사용해야함

buildscript {
    ext {
        springBootVersion = "2.1.9.RELEASE"
    }
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group 'com.book'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}

test {
    useJUnitPlatform()
}

 

gradle 버전 확인

 

다음과 같이 변경하니  BUILD SUCCESS ㅠㅠ

buildscript {
    ext {
        springBootVersion = "2.1.9.RELEASE"
    }
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group 'com.book'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    implementation('org.springframework.boot:spring-boot-starter-web')
    testImplementation('org.springframework.boot:spring-boot-starter-test')
}

test {
    useJUnitPlatform()
}

'스프링부트' 카테고리의 다른 글

머스태치 오류  (0) 2022.08.09
inteliJ 테스트 코드 작성 중 에러  (0) 2022.08.02
빌드하고 실행하기  (0) 2022.03.29
[스프링부트] 프로젝트 생성  (0) 2022.03.18