runtime : 프로젝트를 실행할 때 필요한 의존 라이브러리들. 기본적으로 compile을 모두 포함한다.
runtimeOnly : Gradle이 런타임 시에 사용하도록 빌드 출력에만 종속성을 추가합니다.
testCompile : 프로젝트의 테스트를 컴파일할 때 필요한 라이브러리들. 기본적으로 프로젝트의 컴파일된 클래스들과 compile 의존성을 포함한다.
testRuntime : 프로젝트의 테스트를 실행할 때 필요한 라이브러리들. 기본적으로 compile, runtime, testCompile 의존성을 포함한다.
annotationProcessor : 주석 프로세서인 라이브러리에 종속성을 추가하려면 반드시 annotationProcessor구성을 사용하여 주석 프로세서 클래스 경로에 추가해야 합니다. 그 이유는 이 구성을 사용하면 컴파일 클래스 경로를 주석 프로세서 클래스 경로와 분리하여 빌드 성능을 향상할 수 있기 때문입니다.
Configuration name
Role
Consumable?
Resolvable?
Description
api
Declaring API dependencies
no
no
This is where you should declare dependencies which are transitively exported to consumers, for compile.
implementation
Declaring implementation dependencies
no
no
This is where you should declare dependencies which are purely internal and not meant to be exposed to consumers.
compileOnly
Declaring compile only dependencies
yes
yes
This is where you should declare dependencies which are only required at compile time, but should not leak into the runtime. This typically includes dependencies which are shaded when found at runtime.
runtimeOnly
Declaring runtime dependencies
no
no
This is where you should declare dependencies which are only required at runtime, and not at compile time.
testImplementation
Test dependencies
no
no
This is where you should declare dependencies which are used to compile tests.
testCompileOnly
Declaring test compile only dependencies
yes
yes
This is where you should declare dependencies which are only required at test compile time, but should not leak into the runtime. This typically includes dependencies which are shaded when found at runtime.
testRuntimeOnly
Declaring test runtime dependencies
no
no
This is where you should declare dependencies which are only required at test runtime, and not at test compile time.