Fix Java component publishing When we introduced the `java-library` plugin, we made sure the published POM reflects what a downstream project in the same build would see: `api` dependencies are exposed, `implementation` dependencies are hidden. The legacy `compile`/`runtime` dependencies are exposed as well for backwards compatibility.
We forgot to adjust the tests for the existing `java` plugin, leading to a confusing difference in behavior. The `java` plugin was still hiding the legacy `compile` and `runtime` dependencies from consumers. This was due to a bug in the implementation of `JavaLibrary`, which was looking for the `api` configuration instead of the `apiElements` configuration.