Plugin [id: 'org.springframework.boot'] was not found in any of the following sources: 에러 해결

Dev.choi·2021년 9월 10일
0
post-thumbnail

스프링부트 책을 따라하면서 익히고 있었는데 실습을 들어가자 마자 gradle build부터 오류가 났다. 🤪

Plugin [id: 'org.springframework.boot'] was not found in any of the following sources:

💗orginal code

plugins {
    id 'java'
    id 'eclipse'
    id 'org.springframework.boot' 
    id 'io.spring.dependency-management' 
}

오류가 발생하는 플러그인 코드 뒤에 버전을 명시하니 오류 해결!

💚solving code

plugins {
    id 'java'
    id 'eclipse'
    id 'org.springframework.boot' version '2.2.2.RELEASE'
    id 'io.spring.dependency-management' version '1.0.8.RELEASE'
}

🙄그 외 classpath 오류

그리고 혹시나 이 오류 때문에 삽질하고 있는 사람은 없겠지만.. 공익목적을 위해 적습니다.

💗orginal code

classpath 'org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}'

난 여기서도 오류가 났다. 안타깝게도 정확한 오류명을 저장해두지 않아서 기억이 안나지만 대충 classpath not found in plugin으로 notfoundexception 에러였다. 당연하다. ${ }형식으로 데이터 불러오려면 "큰 따옴표" 써야 한다.

💚solving code

buildscript{
    //springBootVersion이라는 전역변수 생성 및 2.1.7 RELEASE로 초기화
    ext{
        springBootVersion='2.1.7 RELEASE'
    }
    repositories{
        mavenCentral()
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
    }

}

즐코하세요🐈

profile
웹앱 공부 중입니다.

0개의 댓글