반응형
1. dependencies 블록은?
받아올 라이브러리를 정의해두는 공간.
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
위와 같은 dependencies가 있다고 가정하자.
implementation, compileOnly 등 생소한 키워드들이 많은데.. 얘네들은 뒤에 오는 라이브러리들이 적용될 범위(scope)를 정해준다.
2. Keyword 정리
implementation
- 전 범위에 걸쳐 적용된다.
testImplementation
- 테스트 시에만 적용된다.
androidTestImplementation
- 테스트가 수행될 때만 적용된다.
debugImplementation
- 디버그 모드에서만 적용된다.
compileOnly
- 컴파일 할 때만 적용된다.
3. 참고 링크
Managing Dependencies of JVM Projects
How does Gradle know where to find the files for external dependencies? Gradle looks for them in a repository. A repository is a collection of modules, organized by group, name and version. Gradle understands different repository types, such as Maven and I
docs.gradle.org
반응형