Services.gradle.org seems blocked on automated build

I cannot figure out why the creation of a snap (geogebra-discovery) fails on the automated build server:

Downloading https://services.gradle.org/distributions/gradle-6.7.1-bin.zip

Exception in thread "main" java.net.UnknownHostException: services.gradle.org
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:220)

I guess Gradle wants to connect to some servers, maybe services.gradle.org, but this seems blocked. I use my own build machinery to build the application, so I don’t use the gradle plugin.

A similar issue was reported at https://stackoverflow.com/questions/51244696/unable-to-access-gradle-plugin-url-with-snapcraft, but that one used the gradle plugin.

Thanks for any suggestion in advance.

Ancient post I know, but in case it helps anyone else (and as the author of that linked Stackoverflow question which I’ve since updated) - use -Djava.net.useSystemProxies=true as an additional option to Gradle.

Thanks! Finally I learned that if the gradle plugin is used, things just work (connection to outside is allowed). Otherwise, connections to Gradle repositories are blocked.

Just bear in mind that the Gradle plugin is sadly not compatible with the newer corexx bases. I used to use that Gradle plugin, but had to shift away from it (and thus do some more investigating / debugging to work out what was going on.)

Good news though is with the above option you can avoid the plugin entirely if you wish :slight_smile: