The gradle build finds the needed dependencies in this local repository and completes successfully. However, I see that the .gradle\caches\modules-2 cache is not being populated.
When pointing to a remote maven repository, the gradle cache populates correctly.
Is there a way to get the gradle cache to populate when using a local maven repository?
I know it’s strange that I want gradle to cache files that are already local, but I’m trying to isolate the files that the gradle project is dependent on without the remote connection.
Gradle is very good in avoiding unnecessary work.
Copying locally available files to the cache is the opposite, so this is not done.
But actually I had a use-case in the past where this was necessary.
The “local” path was a network share and thus was slow to access and not available without VPN.
So there (before we switched to using HTTP based repository instead) I also wanted the “local” dependencies to be cached.
I found a work-around back then, but removed it 8 years ago when we switched to HTTP based repository.
Because of that I don’t know whether it will still work or maybe with some adjustments.
But what worked back then was this:
You will for sure need to adapt this, for example because it uses Ivy patterns.
But chances are good that with adapted patterns it will also work for your case I’d say.