Gradle and git dependencies


I wonder if Gradle could support git depencies like Bundler (Ruby) is also supporting. E.g.:

gem "nokogiri", :git => "git://", :branch => "1.4"
  1. Is this something Gradle would consider supporting?

  2. Does anybody have any pointers how to start implementing this myself?



Hi Marcel, I’ve implemented one plugin that does just that…


It relies on gradlew and gradle maven plugin, i.e. your git dependencies should be ready so that the plugin can do gradlew install in the local maven repository after fetching from git for you…

Here is how you could declare a dependency:

dependencies {
    compile('org.batcha:dummy-project-a:4.2').ext.git = ''

Regards, Baptiste

Thanks for mentioning this Baptiste,

This is really useful. Unfortunately our project is on hold atm due to other reasons. As soon as we will continue I will have a look at this more closely, but after reading readme on github I think this is interesting.

It might also be of good input for Gradle devs, as they mentioned earlier about supporting such a feature in Gradle core one day.

Yep, it’s part of our long-term plan to make it very easy to substitute pre-built binaries for locally built projects and vice versa. So a project dependency could be fulfilled by a downloaded artifact, or by an artifact built locally. A lot of the current work on “project decoupling” is heading toward this goal.

How to add git credentials to

dependencies {

compile(‘org.batcha:dummy-project-a:4.2’).ext.git = ‘’ }

Daz, can you please share any updates on this feature?

Could you provide more info on current plans for this feature?