1, 下载 maven


2, 配置仓库

<settings xmlns=""
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   | Default: ${user.home}/.m2/repository

3, 配置镜像

    <!-- 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.
      <name>Human Readable Name for this Mirror.</name>
        <name>aliyun maven</name>

4, 配置环境变量

  找到 maven bin 目录, 我的是: C:\maven\apache-maven-3.5.4\bin

  编辑 Path 系统变量, 添加 bin 目录即可(如果是 Win7 注意分号, win10 直接点击新建)

5, 测试

  输入 mvn -version

C:\Users\huanggy>mvn -version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
Maven home: C:\maven\apache-maven-3.5.4\bin\..
Java version: 1.8.0_172, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_172\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"


posted @ 2018-10-02 11:12  huanggy  阅读(116)  评论(0编辑  收藏  举报