Use another repository if first fail

I’m using init.d script to configure our company private maven repository to all project.
It working correctly.
If I’m using any other personal or open source project it still use company repository
It is also not problem, but when I’m not in the company (or on the VPN) this repo is not accessible.
And problem is that gradle build fail on it instead of used others repositories like central or jcenter which is defined in my project.

I think that fallback to the others repositories is main feature of gradle. It works if first repo return 404, but in my cast first repository doesn’t exist (host not found exception). Why in this situation gradle don’t try others repositories?

Hi Tomas,

Does Gradle fail trying to communicate to the unreachable servers? I’ve tried both an invalid domain name for a Maven repo and an unreachable address. When the server is unreachable, the resolve is noticeably slower, but it eventually times out and works as expected.

Is your custom Gradle distribution installed on your path? If you use the wrapper, your personal projects should be able to point to the Gradle distribution on gradle.org instead. You could also look at tools like GVM which let you switch between Gradle versions based on the directory you’re in.

No it try only first server, it return host not found exception and build fail.