maven检查是否安装成功以及配置代理

前言

安装好maven后 idea项目依赖也会时常出问题,排查问题先要检查maven。

一、校验

1、mvn -v

检查maven是否安装 有安装位置版本可以看看,没有重装
 在这里插入图片描述

2、mvn help:system

检查配置文件是否运行,没有success重新打开文件检查,实在检查不出来参考以前的配置文件
在这里插入图片描述

二、配置代理

打开maven setting.xml文件 在 <proxies></proxies>中追加,大概在90行位置
host中写你的代理地址端口号

  <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>
    -->
	<proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
     <!--  <username>proxyuser</username>
      <password>proxypass</password>-->
      <host>127.0.0.1</host>
      <port>8088</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
	</proxy>
  </proxies>

在这里插入图片描述
重复校验第二步,检查配置是否生效(代理)

猜你喜欢

转载自blog.csdn.net/HezhezhiyuLe/article/details/108513318