삽질
[Spring boot / 오류] build.gradle 오류 (gradle버전과 의존성 옵션)
icodesiuuuu
2024. 12. 4. 01:10
gmail API를 사용하기 위해 공식 홈페이지에서 제공하는 레퍼런스를 보면서 dependencies에 추가하다가 오류가 발생했다.
https://developers.google.com/gmail/api/downloads?hl=ko#gradle
Gmail API 클라이언트 라이브러리 | Google for Developers
이 페이지는 Cloud Translation API를 통해 번역되었습니다. 의견 보내기 Gmail API 클라이언트 라이브러리 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. Gmail API는
developers.google.com
dependencies {
//gmail API
compile 'com.google.apis:google-api-services-gmail:v1-rev20211108-1.32.1'
}
에러 내용은 이렇다.

org.gradle.api.GradleScriptException: A problem occurred evaluating root project
대충 이게 문제인거 같다

Gradle 7.0부터 compile은 더 이상 사용되지 않기 때문에 발생한 오류였다. compile을 implementation로 변경하니 작동한다.
dependencies {
implementation 'com.google.apis:google-api-services-gmail:v1-rev20211108-1.32.1'
}

[Spring boot] compile과 implementation
build.gradle에서 compile과 implementation은 모두 의존성을 선언하는 데 사용되지만, 둘 사이에는 중요한 차이가 있습니다. Gradle 7.0부터는 compile이 deprecated(사용 중지)되었고, 대신 implementation과 api로 대
icodesiuuuu.tistory.com