Intellij 社区无法为 Maven 使用 http 代理 [英] Intellij Community can't use http proxy for Maven

查看:32
本文介绍了Intellij 社区无法为 Maven 使用 http 代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在需要使用经过身份验证的代理才能访问 Internet 的 Linux 机器上安装了 Intellij IDEA 社区.我在盒子上有一个系统范围的代理,我在 ~/.m2/settings.xml 中配置了代理.当我从命令行运行时,Maven 正确使用代理.

I have Intellij IDEA Community installed on a Linux box that needs to use an authenticated proxy to get to the Internet. I have a system-wide proxy on the box that works, and I have the proxy configured in ~/.m2/settings.xml. Maven correctly uses the proxy when I run try it from the command-line.

我在 Intellij 中配置了相同的代理,它为我提供了正确的插件列表.但是当我尝试使用 Intellij 与 Maven 存储库同步时,我不断收到此信息:

I have the same proxy configured within Intellij and it gives me the plugins listing correctly. But when I try to sync with the Maven repository withing Intellij I keep getting this:

[WARNING] Unable to get resource 'org.codehaus.mojo:hibernate3-maven-plugin:pom:2.2' 
from  repository restlet (http://maven.restlet.org): Authorization failed: Not   
authorized by proxy.

我转到设置-> Maven 并将代理信息作为属性输入,但没有用.我可以通过查看 Intellij 正在读取我的 ~./m2/settings.xml 的那些设置看到,因为它知道我的本地存储库在哪里(它位于非标准位置).

I went to Settings->Maven and put in the proxy info as properties and that didn't work. I can see by looking at those settings that Intellij is reading my ~./m2/settings.xml fine because it knows where my local repo is (it's in a non-standard place).

有人知道我怎样才能让它工作吗?

Anyone know how I can get this working?

推荐答案

我在 ~/.m2/settings.xml 文件中注释掉了代理配置,让 Intellij 代理信息单独存在,然后在设置中提供属性-> 马文.不知道为什么会这样(也不知道为什么 settings.xml 不能正常工作)但它现在可以工作了.

I commented out the proxy config in my ~/.m2/settings.xml file, let the Intellij Proxy info alone, and then supplied the properties in Setting->Maven. Not sure why that worked (nor why the settings.xml wasn't working right) but it's working now.

这篇关于Intellij 社区无法为 Maven 使用 http 代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆