Add dependencies via transitive dependencies of another configuration in Gradle

I would like Gradle to compute the dependencies for the config by adding the dependencies to the dependencies loaded via the second config.

Example with two Gradle projects:

dependency/build.gradle

:

configurations {
  other
}
dependencies {
  other "bar:artifact1:0.4"
}

      

top/build.gradle

:

configurations {
  other
  modules
}
dependencies {
  modules "foo:dependency:1.0"
  other "bar:artifact2:0.1"
}

      

Thus, the project top

depends on the dependency

through configuration modules

, but I want to the configuration other

in top

contained both "bar:artifact1:0.4"

and "bar:artifact2:0.1"

.

In my particular case, the dependencies other

are listed in the Ivy file for each artifact. I want to collect the dependencies of other

all the artifacts that the project depends on.

This is not a multi-project build, but artifacts from other projects are downloaded from a remote repository.

Is there a way to configure Gradle to include all transitive dependency configurations?

+3


source to share





All Articles