How can I set gradle proxy to socks

I use socks as my proxy server.
And I put those in my gradle_home/gradle.properties

systemProp.http.proxyHost=socks5://127.0.0.1
systemProp.http.proxyPort=1080

systemProp.https.proxyHost=socks5://127.0.0.1
systemProp.https.proxyPort=1080

But the ./gradlew task’s log syas:

Gradle Bintray Plugin version: 1.6
Using proxy null:@socks5://127.0.0.1:1080

Execution failed for task ':thyi:bintrayUpload'.
> java.net.UnknownHostException: socks5://127.0.0.1

My questions is, can I use sock proxy in gradle. And how can I set this.

Thanks!

I have resolve it.

add this line to gradle.properties

org.gradle.jvmargs=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=7077

2 Likes

Thanks and: Is there “-Dxxx” equivalent for “system.Prop.http.nonProxyHost”?

Update: ref java - How to set nonProxyHosts for a SOCKS proxy? - Stack Overflow, maybe the answer is no?

It used to works as after adding file as described above.
But now I have gradle 6.5.1 build.gradle.kts and adding gradle.properties files doesn’t have any effect