provided
- compile-time only dependency
package
- package-time only dependency
compile
- compile-time and package-time dependency
provided
is commonly used for annotation processing based libraries. Usually these libraries are separated in two artifacts - "annotation" and "compiler". "compiler" is provided
dependency because you do not need to use it in application, only for compilation; and "annotation" is compile
dependency - it is used in application code and therefore compiles. Or generated code may require additional dependencies while your application may not. E.g. dagger dependencies configuration:
compile 'com.squareup.dagger:dagger:1.2.2'
provided 'com.squareup.dagger:dagger-compiler:1.2.2'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…