Is there a way to work around a dependency repository being unavailable or offline?

(Martin Jöhren) #1

When I use

configurations.all { resolutionStrategy.cacheChangingModulesFor 1, 'MINUTES' }

and I have defined a repository (host), which is currently not available, I get a build failure. Is there a way to configure the resolution strategy to use the already downloaded dependency (if available) when the host is not available and only throw a build exception when the dependency is missing and the host too? In my case i am only connected to the host when I am connected to the network of my company but when I am working from home and I already downloaded the dependency it would be nice to have that feature.

Well I know, I can use groovy to define a switch which just turns off the resolution strategy but it would be nice to have it out of the box or by setting a flag.

(Luke Daley) #2

This is GRADLE-320.

There is no way to make this work right now unfortunately beyond very large timeouts. I’m going to mark this as answered, though the problem does persist.

Please follow GRADLE-320 to follow this issue. It’s something that is actively being worked towards.

(Martin Jöhren) #3

thx for your quick answer. Seems that I have to live with my workaround for while…

(Luke Daley) #4

No problems, you shouldn’t have to use your workaround for too much longer.

(Martin Jöhren) #5