Java-library "implementation" dependencies

According to chapter 48.2 “API and implementation separation”;

dependencies do not leak into the compile classpath of consumers anymore, so you will never accidently depend on a transitive dependency

How am I supposed to declare my dependency as a consumer to make this true?

My setup:
lib (with java-library plugin)

dependencies {
    implementation project(':reactivestreams-utils')
    implementation ''
    api "org.reactivestreams:reactive-streams:$reactiveStreamsVersion"
    api ''

consumer (with java plugin)

dependencies {
    compile '<lib>'

AFAIK this will make the default resource set part of the consumers compile resource set. Hence including runtime dependencies, and voilà, behold the guts of my library :frowning:

It doesn’t matter which Configuration (compile, compileOnly, api, implementation) the consumer uses, it will not see the implementation details of the library.

You can also use the implementation Configuration in the java plugin btw.

My experience from earlier today tells a different story. They are visible on the compile classpath.
I deploy to a maven repo (in the pom, the deps have “runtime” scope). I also resolve the dependency in my service from the same maven repo…

Variant aware dependency management does not yet work with external dependencies, only with project dependencies. See this issue.

Ok, thanks :thumbsup: