windows下maven安装与eclipse配置

一、下载maven

解压zip文件


上面的zip下错了,应该下载-bin.zip,这样解压出来的文件夹里有bin文件夹,-src.zip解压出来没bin文件夹

二、配环境变量




cmd命令行输入

mvn -v


说明ok

三、配置maven远程仓库镜像(可选)

修改conf文件夹下的settings.xml文件

将mirrors项中加阿里云

  <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
	    <mirror>
            <id>aliyun</id>
            <name>aliyun Maven</name>
            <mirrorOf>*</mirrorOf>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        </mirror>
  </mirrors>

四、添加外部自己安装的maven


更新配置


eclipse打开windows-show view-other- maven-repositories


能够看到那个镜像




参考:

https://blog.csdn.net/lei273834/article/details/73089893

https://blog.csdn.net/java_2017_csdn/article/details/77450598/




猜你喜欢

转载自blog.csdn.net/dongyuguoai/article/details/80977249