6

I wonder how I could set a SOCKS proxy for maven via the ~/.m2/settings.xml? Yes, I know there is a recipe to do this via MAVEN_OPTS environment variable. But I would like to set this in the settings.xml within the <proxies> section. Which kind of protocol should I use? I already tried

  • socks
  • socks5
  • SOCKS_5
  • SOCKSv5

Regs, Gerd

Gerd Aschemann
  • 494
  • 5
  • 14
  • Similar question, without answers http://stackoverflow.com/questions/34267443/maven-to-use-socks-proxy-for-specific-repo – Tunaki May 19 '16 at 10:42
  • And also related http://stackoverflow.com/questions/17129327/how-do-i-configure-maven-to-use-tor – Tunaki May 19 '16 at 10:43
  • And also related https://stackoverflow.com/questions/50943317/maven-not-downloading-jars-behind-proxy – Faizan Mubasher Jun 20 '18 at 13:07

1 Answers1

5

This is my setting, and it worked fine for me,hope useful:

<proxy>
        <id>ss</id>
        <active>true</active>
        <protocol>socks5</protocol>
        <username></username>
        <password></password>
        <host>127.0.0.1</host>
        <port>1080</port>
        <nonProxyHosts>127.0.0.1</nonProxyHosts>
</proxy>
DavidG
  • 24,279
  • 14
  • 89
  • 82
Shawn Chang
  • 79
  • 1
  • 6