isPowerfulBlog

[Gradle] Could not find method compile() 본문

Infra

[Gradle] Could not find method compile()

왕밤빵도라에몽 2022. 11. 25. 16:18

ELK 테스트를 위해 스프링배치로 로그를 쏴주려는데 빌드 에러가 났다.

./gradlew build

스크린샷, 2022-11-25 16-02-33

* Where:
Build file '/home/kueyeon/workspace/engi_adv/demo/build.gradle' line: 28
  • build.graldle 28번째 줄에서 에러가 났고 -> compile 'net.logstash.logback:logstash-logback-encoder:6.3'
* What went wrong:
A problem occurred evaluating root project 'demo'.
> Could not find method compile() for arguments [net.logstash.logback:logstash-logback-encoder:6.3] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
  • compile() 메소드를 찾을 수 없다는...

image

  • compile()Gradle 7.0 이후로 사라졌다고 한다...

스크린샷, 2022-11-25 16-02-48

  • compile -> implementation 으로 변경하여 해결했다.

References

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