4

For reasons out of my control I'm unable to resolve plugins from the internet. I want to know how can I manually install the plugins I need so gradle finds them.

I found the .gradle folder and I assume they'll be downloaded there, but have no idea where I should put them.

Any help is more than welcomed.

javydreamercsw
  • 5,363
  • 13
  • 61
  • 106

2 Answers2

3

The gradle cache in .gradle is a bit finicky, and not really meant to be changed manually. See some additional information about making gradle cache portable here: https://stackoverflow.com/a/34973244/745574

Maybe the best way to cache plugins offline is to find a way to add the plugin binaries to you local .m2 folder - maven cache is more forgiving of copy pasting files.

Community
  • 1
  • 1
RaGe
  • 22,696
  • 11
  • 72
  • 104
1

As mentioned in How to make Gradle repository point to local directory, we can use

repositories {
   flatDir {
       dirs 'D:/path/to/local/directory'
   }
}

or

repositories {
   maven {
       url 'file://D:/path/to/local/directory'
   }
}

and put all *.jar and *.pom files into this directory.

If you write not absolute path, it will be resolved relatively folder with this gradle file.

Also there is a note: flatDir repository doesn't support transitive dependency resolution, while maven local repository does.

Nashev
  • 490
  • 4
  • 10