公司电脑使用maven3.0.5遇到 Proxy Authentication Required

公司电脑使用maven3.0.5 遇到 Proxy Authentication Required 提示,即maven不能访问网络。

公司的网络架构是通过一个代理服务器上网,但是按一般方式 设置上网代理,Maven任然不能访问网络。

 

该帖子底下的有问题提问,并且也给出相应的解决方案:

参考:http://www.mkyong.com/maven/how-to-enable-proxy-setting-in-maven/

 

该帖子说明的为什么 Maven3+  虽然设置的代理,但是为什么还是不能够访问网络:

参考:http://www.cnblogs.com/mikelij/p/3203377.html 

 

为了以后查找的方便,我把它复制过来了,希望写该帖子的大神不要介意,对我帮助非常大,在此表示感谢!如果觉得侵犯你的版权,我会立即删除。

maven integration with eclipse 3.0.4 does not work with NTLM proxy

Recently downloaded m2e(maven integration with eclipse). The version is 3.0.4. My environment is behind a NTLM proxy. Looking like both Eclipse and mavne having issues to work with NTLM proxy. Found maven did not work with the proxy. Tried to set the proxy in settings.xml file like this:

  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.somewhere.com</host>
      <port>8080</port>
      <username>proxyuser</username>
      <password>somepassword</password>
      <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
    </proxy>
  </proxies>

It did not work.

Later tried to specify the http proxy information in the JVM parameter.

-Dhttp.proxyPort=8080(your port)

-Dhttp.proxyHost=192.168.19.200(your IP)

-Dhttp.nonProxyHosts=localhost|127.0.0.1(排除localhost,和127.0.0.1使用proxy)

It did not work also.

But I found the command line maven 2.2.1 worked well using the settings.xml.

Later I downloaded a command line maven 3.10, I found the command line maven 3.1.0 did not work also. Both the settings.xml and JVM parameter did not work. So I research more. Later I found out the root cause is that the maven 3.0.4 or above is having issues with the NTLM proxy(There are other types of proxy, here it is NTLM proxy.).  For the command line maven 3.1.0, we can download a extension jar file http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-http-lightweight/2.2/wagon-http-lightweight-2.2.jar

and save it to <command line maven home directory>/lib/ext.

and then commane line maven worked well with NTLM proxy.

For the m2e(the integrated maven with eclipse), I have not found any workable solution. Maybe we have to add an external maven installation in m2e. That way we can at least make a workable m2e.

Let me try out.

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值