DevOps / Gradle interview questions
Difference between api and implementation in Gradle.
The api configuration should be used to declare dependencies which are exported by the library API, whereas the implementation configuration should be used to declare dependencies which are internal to the component.
dependencies { api 'org.apache.httpcomponents:httpclient:4.5.7' implementation 'org.apache.commons:commons-lang3:3.5' }
Dependencies appearing in the "api" configurations will be transitively exposed to consumers of the library, and as such will appear on the compile classpath of consumers. Dependencies found in the "implementation" configuration will, on the other hand, not be exposed to consumers, and therefore not leak into the consumers' compile classpath.
More Related questions...