1、官网下载maven

2.解压、配置环境变量(与配置JDK类似)

     测试是否配置好   :   mvn    -version

3.修改conf中setting.xml文件

       a,设置maven的本地存储位置

                  <localRepository>、、(存储下载文件的位置)</localRepository>  

       b,设置国内的下载镜像             

                <mirror>
                <id>alimaven</id>
                <name>aliyun maven</name>
                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
                <mirrorOf>central</mirrorOf>
                </mirror>

         c,修改创建maven项目的默认JDK版本

                 <profile>
                 <id>jdk-1.8</id>
                <activation>
                <activeByDefault>true</activeByDefault>
               <jdk>1.8</jdk>
               </activation>
               <properties>
               <maven.compiler.source>1.8</maven.compiler.source>
               <maven.compiler.target>1.8</maven.compiler.target>
              <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
              </properties>
              </profile>

4.在eclipse中的Windows下preference选项卡下的maven、installation、user setting做修改

          a,maven    勾上download    Artifct   Sources

          b,installation    添加保存好的maven文件 

          c,  user  setting      添加配置好的setting.xml文件

5.创建maven项目

         

posted on 2018-01-09 17:45  toIterator  阅读(84)  评论(0)    收藏  举报