Gradle: Add a way to specify the repo for each module

Created on 10 Dec 2018  路  1Comment  路  Source: gradle/gradle

Expected Behavior

Make it possible to explicitly set (force/restrict) the source repo per module.

Current Behavior

For building my Android app, I use a few modules. Some of them are available on JCenter, but some exist only on Google repo and some are taken from JitPack.

Suppose I have the following:

  • module1: available in google and jcenter
  • module2: only google
  • module3, module4: only jcenter
  • module5: only jitpack

For whatever reason, module1 in jcenter is not up to date, so I want to take it from Google.

The list of repos in my build file is thus:

  • google
  • jcenter
  • jitpack

This setup makes sure module1 will be taken from google's repo. But it also means Google's servers will be contacted for all the other modules (to get maven-metadata.xml etc). Google may or may not use this information to track 3rd party module usage by Android applications; but it certainly means the build process suffers, because module5 will be taken from jitpack only after contacting google and jcenter and not finding it there.

To make it work, I have to list all repos in build.gradle, and then

Context

See above.

Your Environment

See above. The example uses Android and Google because that's my specific use case, but it doesn't really matter; any Maven repo owner will get hits for modules not hosted by it, they may choose to track those hits, and the build process will be delayed.

Most helpful comment

Dupe of https://github.com/gradle/gradle/issues/1369 - this will be in 5.1

>All comments

Dupe of https://github.com/gradle/gradle/issues/1369 - this will be in 5.1

Was this page helpful?
0 / 5 - 0 ratings