How do you depend on one artifact of from a project that declares two artifacts

I found an example in the repository that shows you how to create a project that produces an api and impl jar

Is it possible to declare a dependency on just the api from another (sub) project and if so what would be the syntax for that

shameless self bump

Basically, you publish the Jars under two different configurations and then depend on a particular one from the other project. Something like:


configurations {
  artifacts {
  api taskThatProducesApiArtifact
  impl taskThatProducesImplArtifact


dependencies {
  compile project(path: ":projectA", configuration: "api")