• 首页
  • 狐文
  • 狐图
  • About
狐窝
OvO
  1. 首页
  2. 未分类
  3. 正文

Maven启用代理访问

2019年04月21日 209点热度 0人点赞 0条评论
linuxprobe.com
如果你的公司正在建立一个防火墙,并使用HTTP代理服务器来阻止用户直接连接到互联网。如果您使用代理,Maven将无法下载任何依赖。

为了使它工作,你必须声明在 Maven 的配置文件中设置代理服务器:settings.xml.

1. Maven配置文件

找到文件 {M2_HOME}/conf/settings.xml, 并把你的代理服务器信息配置写入。注:{M2_HOME}  => D:\software\yiibai.com\apache-maven

{M2_HOME}/conf/settings.xml
<!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
  </proxies>

取消注释代理选项,填写您的代理服务器的详细信息。

<!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
      <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>yiibai</username>
      <password>password</password>
      <host>proxy.yiibai.com</host>
      <port>8888</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
  </proxies>

2. 保存文件

完成后,Apache Maven 应该是能够通过代理服务器立即连接到Internet。

注意:重新启动不是必需的。Maven 只是一个命令,当你调用它,它会再次读取该文件。

原文出自【易百教程】,商业转载请联系作者获得授权,非商业转载请保留原文链接:https://www.yiibai.com/maven/enable-proxy-setting-in-maven.html

标签: 暂无
最后更新:2019年04月21日

OvO

狐狸

点赞
< 上一篇
下一篇 >
最新 热点 随机
最新 热点 随机
brave编译打包时dump_syms报错Couldn't locate EXE or DLL file 使用Windows Kits创建PE 及精简镜像 Windows精简部署相关简易内容 APC UPS SUA1000ICH 踩坑记 TrueNAS SCALE虚拟机无法 Ping主机 TrueNas Scale libvirt-sock RDMA RoCE相关资料 Linux系统修改网卡名(eth0-3) Linux系统打开SRIOV 构建android内核时DTC工具中的多个定义错误 Windows 来宾系统提示“安全删除硬件” 修改jar的三种方法(反编译jar) 如何在 Debian 10上安装和配置 VNC Openwrt内SR-IOV网卡桥接问题 Linux下编译android 时报错loadlocale.c:130 windows 查看文件夹被那个进程占用 MongoDB中的多表关联 mongodb 学习记录
Chromium代码编译选项介绍 git出现 You are in the middle of a merge -- cannot amend问题解决方法 Windows精简部署相关简易内容 查看哪些ip破解你ssh密码以及次数 〖最全〗pycharm+ipython notebook搭建(for mac) Maven启用代理访问 VMware虚拟机磁盘操作占用过高问题 为什么debian我安装 apt-spy 时候说没找到 linux 技巧:使用 screen 管理你的远程会话 apt与apt-get的区别 Js 拦截全局ajax请求 Debian防火墙问题 Linux桌面密码管理器:Bitwarden,Buttercup,KeePassXC,Enpass,myki 消除LINUX下蜂鸣器的声响 Maven仓库理解和优先级 Linux VPS主机安全 不笑不行了--来自2015 提取安卓的Linux内核和驱动
标签聚合
下载 ssl docker chrome 密码 http 编译 e 文件 linux https git android 路由 网卡 com

COPYRIGHT © 2020 狐窝. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS