본문 바로가기
Error & Exception

[Gradle] Could not find method compile() for arguments [org.springframework.boot:spring-boot-starter-web] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

by unknownomad 2021. 11. 16.

에러 메시지

build.gradle 초기 설정 시

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

 

하기와 같이 에러 발생

Could not find method compile() for arguments
[org.springframework.boot:spring-boot-starter-web] on object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

해결 방법

1. Gradle 버전 확인

  • compile, testCompile 메서드가 Deprecated됨

 

2. Gradle ver.7일 경우

  • compile ➡ implementation
  • testCompile ➡ testImplementation

 


출처 : https://okky.kr/article/997902

댓글