본문 바로가기
Dependency Manager/Gradle

Gradle dependency 초기화

by BAYABA 2021. 10. 10.
  1. 개인 공부 목적으로 작성한 글입니다.
  2. 아래 출처를 참고하여 작성하였습니다.

목차

  1. Intro
  2. Intellij - Invalidate Caches / Restart...
  3. gradlew build refresh dependencies

1. Intro

  1. Gradle dependency를 초기화하는 방법에 대해 알아보겠습니다.
  • 사용하는 라이브러리의 버전은 그대로인데 라이브러리 내용이 달라져서 라이브러리를 다시 import해야하는 경우
  • Gradle에서 Dependency들을 제대로 불러오지 못하거나 꼬이는 경우

2. Intellij - Invalidate Caches / Restart...

  1. Intellij 환경에서 gradle 관련해서 꼬이거나 문제가 생기면 이 방법으로 시도해보는 것을 추천합니다.
  2. project와 관련된 dependency들을 초기화하고 재시작시켜줍니다.
Shift 두번 연타 -> invalidate 입력 (Invalidate Caches / Restart... 선택) -> 엔터

3. gradlew build refresh dependencies

  1. gradle에서 제공하는 방법으로 dependency들에 대해 refresh를 시킵니다.
  2. 해당 옵션에 대해 아래와 같이 설명하고 있습니다.
  • To refresh all dependencies in the dependency cache, use the --refresh-dependencies option on the command line.
프로젝트 위치로 이동 
$ ./gradlew build --refresh-dependencies

출처

  1. Gradle dependency 초기화

'Dependency Manager > Gradle' 카테고리의 다른 글

GradleWrapper 버전확인  (0) 2021.10.19
Gradle jar 패키징 방법 (SpringBoot)  (0) 2021.10.06
외부 .jar 파일 추가 방법 (SpringBoot)  (0) 2021.10.06