Maven Proxy settings.xml被忽略 [英] Maven Proxy settings.xml ignored

查看:170
本文介绍了Maven Proxy settings.xml被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许有人可以帮助我解决以下问题:

Maybe someone can help me with the following Problem:

我已经在M中声明了代理,如 maven-配置代理所述.

I have declared a proxy in M as described at maven - Configuring a proxy.

出于某种原因,尽管通过命令行设置代理时代理本身可以与maven一起正常工作,但该代理会被忽略.

For some reason the proxy is ignored, although the proxy itself works correctly with maven when setting the proxy via command line.

当这样调用Maven目标时,它会起作用:

When calling the maven goal like this, it works:

mvn -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=3128 eclipse:eclipse

对这个问题有什么建议吗?

Any suggestions for this problem?

推荐答案

忽略settings.xml时,我倾向于首先检查环境变量 M2_HOME :

When settings.xml is ignored, I tend to check first if the environment variable M2_HOME:

  • 存在于当前的shell会话中
  • 指的是所述settings.xml
  • 的父目录
  • exists in the current shell session
  • refers to the parent directory of said settings.xml

mglauche 注释:

M2_HOME应指定要使用的系统 settings.xml.
您仍然在${home}/.m2/settings.xml中拥有用户设置,该设置会覆盖系统设置中的所有内容.

M2_HOME should specify the system settings.xml to use.
You still have your user settings in ${home}/.m2/settings.xml, which should overwrite anything in the system settings.


对于Maven Eclipse,如注释中提到的 mglauche 所述,请在maven首选项中指定完整路径:


For Maven Eclipse, as mglauche mentions in the comments, specify the full path in the maven preferences:

这篇关于Maven Proxy settings.xml被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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