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

(adaro!) #1

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

(adaro!) #2

shameless self bump

(Peter Niederwieser) #3

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")

(adaro!) #4