IntelliJ IDEA添加MAVEN插件

打开 File → Other Settings → Default Settings 

这里写图片描述

修改MAVEN默认的地址,重新选择配置文件

这里写图片描述
☆特别注意,在配置的时候一定要选择 Default Settings要不然每次新建其他工程都会默认使用IDEA自带的MAVEN

修改MAVEN安装路径下conf文件中的settion.xml文件

  1.设置默认仓库地址(我这里设置的是本地D:JAVAToolsMvnRepo) 
这里写图片描述

  2.设置MAVEN的远程仓库路径,默认的地址由于国内特殊原因比较慢,我一般只用了第一个阿里的远程仓库
这里写图片描述

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

    <mirror> 
       <id>uk</id>  
       <mirrorOf>central</mirrorOf>  
       <name>Human Readable Name for this Mirror.</name>  
       <url>http://uk.maven.org/maven2/</url> 
    </mirror>

    <mirror>
       <id>CN</id>
       <name>OSChina Central</name>
       <url>http://maven.oschina.net/content/groups/public/</url>
       <mirrorOf>central</mirrorOf>
    </mirror>

    <mirror>
      <id>nexus</id>
      <name>internal nexus repository</name>     
      <url>http://repo.maven.apache.org/maven2</url>
      <mirrorOf>central</mirrorOf>
    </mirror>  

  修改完setting.xml文件后将setting.xml文件复制一份到你刚刚定义的默认仓库地址中
  本地要先安装配置好maven,安装好maven后,配置maven本地仓库和远程仓库,配置好后在开发工具idea或eclipse中配置好maven配置就ok了

 

原文地址:https://www.cnblogs.com/jingjiren/p/12820906.html