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

Maven启用代理访问

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

狐狸

点赞
< 上一篇
下一篇 >
最新 热点 随机
最新 热点 随机
钛备份或小米系统备份功能备份出来的APK无法正常还原 BBR安装启用 安装docker mitmproxy 调试方法 Android SDK 版本选择 Perdition Mail代理服务器配置 HAProxy SSL代理 Openssl 中间人SSL代理 Stunnel SSL to SSL代理 NGINX反代IMAP配置 各种设备User Agent Torrent下载工具推荐 用 rar2john+hashcat 破解 RAR 文件密码 2020最好的Linux发行版 关闭新版chrome工具栏上拼图图标 Office 下载、安装、激活,有它就够了! Android 非官方的发行版 openwrt添加autoconf-archive
linux 技巧:使用 screen 管理你的远程会话 FreeNAS禁用IPv6 和 jails 启用IPv6 Mysql开启远程连接方法 【插件】再谈网络运维人员的火狐(firefox)扩展 如何查看你的VPS是什么虚拟化架构? JDBC连接数据库使用SERVICE NAME、SID以及TNSName不同写法 debian SSD ext4 4K 对齐 Maven仓库理解和优先级 jdbc连接数据库使用sid和service_name的区别 PHP获取操作系统、IP、地理位置、浏览器、ISP等信息_PHP类代码 Debian sid基本配置(从stable/testing升级) Debian8 更新源配置 OpenWrt 编译 LuCI ---> Applications 添加插件应用说明 公共 NTP 服务器地址大全 Public NTP Server SSH免密码登录 使用 bitwarden_rs 搭建自托管的密码服务器 VMware虚拟机磁盘操作占用过高问题 Oracle递归查询
标签聚合
docker chrome 密码 下载 路由 chromium linux 镜像 https blog ssl 安装 yum 网卡 e git

COPYRIGHT © 2020 狐窝. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS