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

Maven启用代理访问

2019年04月21日 241点热度 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

狐狸

点赞
< 上一篇
下一篇 >
最新 热点 随机
最新 热点 随机
EFI Shell 命令参考命令 说明 证书的SCT相关 ssl证书生成时插入OID TrueNAS SCALE docker安装使用联合文件系统mergerfs Iptables 端口(流量)转发 如何在GIT中删除第一个提交 TrueNas 虚拟机无法连接主机 dnsmasq ipset iptables 实现对流量进行分流 新版 Ubuntu 修改IP DCHP K3S 创建portainer 通过声音进行数据传输 Windows精简部署相关简易内容 ConstraintLayout 和 Coordinator 对比 Android 为View分配id wireshark解析TCP tcpdump rpcapd 相关编译方法 双网卡调整优先级 Android 禁用IPv6
EFI Shell 命令参考命令 说明
如何在Debian中启用测试版/不稳定版的软件库 Selenium Chrome浏览器的启动以及proxy设置 国内外几款好用的网络质量测试工具推荐 CentOS 7 为firewalld添加开放端口及相关资料 Torrent下载工具推荐 Windows 来宾系统提示“安全删除硬件” 为什么debian我安装 apt-spy 时候说没找到 蓝牙设备 Windows和Ubuntu 双系统配置 使用Windows Kits创建PE 及精简镜像 Linux 下大家喜欢用什么命令查看流量? MySql5.7创建数据库与添加用户、删除用户及授权 APC UPS SUA1000ICH 踩坑记 英特尔服务器主板24针前面板接口说明 查看oracle数据库的编码及修改编码格式的方法 Linux下弹出U盘的代码 /etc/security/limits.conf的相关说明 在 Win10 上安装重复数据删除 chrome 扩展推荐
标签聚合
linux 编译 下载 android https chrome ssl ipv windows 未分类 http com docker 密码 网卡 git

COPYRIGHT © 2020 狐窝. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS