Eclipse (STS) HTTP 代理配置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17840353/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 20:57:25  来源:igfitidea点击:

Eclipse (STS) HTTP Proxy Configuration

eclipseproxyspring-tool-suite

提问by Mac

I upgraded from Spring Tool Suite (STS) 3.2 to STS 3.3 and it has brought a few issues with it.

我从 Spring Tool Suite (STS) 3.2 升级到 STS 3.3,但它带来了一些问题。

When trying to download plugins, I get "Proxy Authentication Required.." errors.

尝试下载插件时,出现“需要代理身份验证..”错误。

I have my http proxy configured correctly (the same way as 3.2). I have even compared all the .ini files between the versions and cannot find a difference.

我的 http 代理配置正确(与 3.2 的方式相同)。我什至比较了版本之间的所有 .ini 文件,但找不到差异。

As many posts have suggestion, I have also cleared the SOCKS proxy, and even tried to specify in the .ini files that it is not to be used- but again without any luck.

由于许多帖子都有建议,我还清除了 SOCKS 代理,甚至尝试在 .ini 文件中指定不使用它 - 但再次没有任何运气。

I have tried configuring the HTTPS proxy and playing with the properties in the .ini files for both, restarts, running under different permissions, ect...

我已经尝试配置 HTTPS 代理并使用 .ini 文件中的属性,重新启动,在不同的权限下运行,等等...

Could use some new ideas on this one.

可以在这个上使用一些新的想法。

Thanks a lot for reading.

非常感谢阅读。

采纳答案by spud

The same thing just happened to me on installing STS 3.4. I could only get the proxy to work by switching my proxy provider to manual, editing the http schema and adding my proxy username and password. Less than ideal.

我在安装 STS 3.4 时也发生了同样的事情。我只能通过将我的代理提供程序切换为手动、编辑 http 模式并添加我的代理用户名和密码来使代理工作。不太理想。

If I remove STS, the native proxy provider starts working again.

如果我删除 STS,本机代理提供程序将再次开始工作。

回答by intersum

I had the same problem. It turned out that this was caused by two plugins. To allow your STS to connect to the internet via proxy just delete this two plugins:

我有同样的问题。原来这是两个插件造成的。要让您的 STS 通过代理连接到互联网,只需删除这两个插件:

  • org.apache.httpcomponents.httpcore_4.2.4.v201305222326.jar

  • org.apache.httpcomponents.httpclient_4.2.5.v201305222326.jar

  • org.apache.httpcomponents.httpcore_4.2.4.v201305222326.jar

  • org.apache.httpcomponents.httpclient_4.2.5.v201305222326.jar

There should be older versions of this plugins so everything should be working fine.

应该有这个插件的旧版本,所以一切都应该正常工作。

回答by LightDye

I had to add the following 2 lines to STS.ini file. The first line at the top of the file and the second line at the bottom of the STS.ini file:

我必须将以下两行添加到 STS.ini 文件中。文件顶部的第一行和 STS.ini 文件底部的第二行:

-clean
...
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4

Then on the following file, which exists in the STS (Eclipse) installation folder...

然后在以下文件上,该文件存在于 STS (Eclipse) 安装文件夹中...

configuration\.settings\org.eclipse.core.net.prefs

...I had to enable proxies making sure that the following properties were set to true:

...我必须启用代理以确保以下属性设置为 true:

proxiesEnabled=true
systemProxiesEnabled=true 

Only after doing this and rebooting STS, the proxy settings I had entered through the UI previously, took effect.

只有在执行此操作并重新启动 STS 后,我之前通过 UI 输入的代理设置才会生效。

Edit (2020-01-30): If the file org.eclipse.core.net.prefsdoesn't exist, just create with the following basic content. Edit as needed.

编辑(2020-01-30):如果org.eclipse.core.net.prefs文件不存在,只需创建以下基本内容。根据需要进行编辑。

eclipse.preferences.version=1
nonProxiedHosts=localhost|127.0.0.1|another-host-in-your-LAN
org.eclipse.core.net.hasMigrated=true
proxiesEnabled=true
systemProxiesEnabled=true
proxyData/HTTP/hasAuth=true
proxyData/HTTP/host=your-proxy
proxyData/HTTP/port=80
proxyData/HTTPS/hasAuth=true
proxyData/HTTPS/host=your-proxy
proxyData/HTTPS/port=80

回答by UgurOzcanli

There is an open issue: https://issuetracker.springsource.com/browse/STS-3647

有一个未解决的问题:https: //issuetracker.springsource.com/browse/STS-3647

It is recommended to download the latest nightly build.

建议下载最新的 nightly build。