通过代理脚本进行Maven配置

时间:2018-08-22 14:41:14

标签: java git maven proxy

我需要在公司这里开发应用程序。在公司的网络内部,有一个* .pac文件,该文件根据请求确定目的地。 在互联网上搜索后,我将git用作版本控制并将maven用作依赖项管理器,在互联网上搜索后,我发现以下链接可帮助我将git配置为正常工作:

Getting git to work with a proxy server

不幸的是,对于Maven,我找不到使它工作的方法。 我检查了以下链接,但似乎都不起作用:

https://www.mkyong.com/maven/how-to-enable-proxy-setting-in-maven/

https://maven.apache.org/guides/mini/guide-proxies.html

一些评论告诉我们在.m2文件夹中配置settings.xml文件,我这样配置它:

void ShowAlert(string message, double seconds)
{
    alertDelay = NSTimer.CreateScheduledTimer(seconds, (obj) =>
    {
        dismissMessage();
    });
    alert = UIAlertController.Create(null, message, UIAlertControllerStyle.Alert);
    UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(alert, true, null);
}

即使如此,它也不起作用。

有人遇到过这个问题,有人知道如何解决吗?

1 个答案:

答案 0 :(得分:0)

伙计,请切断此ID,仅使用http,例如:

<proxy>
  <!--<id>optional</id> -->
  <active>true</active>
  <protocol>http</protocol>
  <username>user</username>
  <password>passwrod</password>
  <host>proxy address without "http://" </host>
  <port>proxyport</port>
  <nonProxyHosts>*.yourdomain.com</nonProxyHosts>
</proxy>    

我将具有此配置的文件setting.xml仅放在我的.m2文件夹中,对我来说就像一个魅力。