3

I tried to do a maven clean for a project in Visual Studio Code but I got an exception of java.net.UnknownHostException: repo.maven.apache.org. I suspect this is caused by proxy as the development environment here requires a proxy for Internet access, and we use .pac file in IE proxy setting.

In File -> Preferences -> Settings -> User -> Application -> Proxy, I setup the proxy address as http://username:password@my.proxy.address:8080. In settings.json, I put as followings:

{
    "http.proxy": "http://username:password@my.proxy.address:8080",
    "https.proxy": "http://username:password@my.proxy.address:8080",
    "http.proxyStrictSSL": false
}

Now I am able to search for extensions, but terminal is not working. How can I solve it?

Felix Wong
  • 161
  • 5
  • 15
  • Does this answer your question? [How do I use Maven through a proxy?](https://stackoverflow.com/questions/1251192/how-do-i-use-maven-through-a-proxy) – gclaussn Apr 01 '20 at 10:48
  • Sorry I missed that information. I also have settings.xml in .m2 folder as well. In fact, STS can perform maven actions successfully. It's just Visual Studio Code can't. – Felix Wong Apr 01 '20 at 11:10
  • if Maven works in a normal terminal, it should work in the vscode terminal as well. Do you use the vscode-maven plugin? you may have to look into: https://github.com/Microsoft/vscode-maven/tree/master#additional-configurations – gclaussn Apr 02 '20 at 19:36

1 Answers1

0

If you want to use the proxy in the terminal (f.e. vsc) you have to update the system variables:

http_proxy http://username:password@my.proxy.address:8080
https_proxy http://username:password@my.proxy.address:8080
max
  • 330
  • 3
  • 13