Clone
Stefan Oehme
committed
on 19 Jan 17
Fix backwards compatibility of new Java configurations
When a `java` or `java-library` project is referenced from another project
that doesn… Show more
Fix backwards compatibility of new Java configurations

When a `java` or `java-library` project is referenced from another project

that doesn't know about the `usage` attribute, then all runtime dependencies

need to be exposed. This is necessary e.g. when packaging EARs or applications.

At the same time we want to have the minimal set of leaked dependencies for

consumers that do know about `usage`. The solution is to move the `apiElements`

configuration up to the `java` plugin and let it contain `compile` and `runtime`

for backwards compatibility. The `default` configuration contains everything on the

`runtimeClasspath`.

Once `compile` and `runtime` have been removed in some future Gradle version,

we will have exactly what we want: An empty API for `java` projects and only

exposing the `api` configuration for `java-library` projects.

Show less

master + 477 more