본문 바로가기
안녕하세요 에러 선생님

Gradle Could not find method compile() 에러

by 설이주인 2022. 6. 6.

Gradle 프로젝트 초기 설정에서  만난 에러다

 

Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: 

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.

 

 

(초기 단계에서 에러와 만나서 깊은 상처와 구글 형님에게 달려갔다)

 

compile, runtime, testCompile, testRuntime 은 Gradle 4.10 (2018.8.27) 이래로 deprecate 되었다.
그리고 Gradle 7.0 (2021.4.9) 부터 삭제되었다.

 

저런 그들은 사라졌군요...

 

현재 프로젝트는 Gradle 7.4를 사용하고 있기에 명령어를

implementation, runtimeOnly, testImplementation, testRuntimeOnly로 바꿔주면 된다.

 

compile -> implementation 로 변경해주자


도움 주신 stackflow 감사합니다!

https://stackoverflow.com/questions/23796404/could-not-find-method-compile-for-arguments-gradle