其他分享
首页 > 其他分享> > IntelliJ IDEA添加MAVEN插件

IntelliJ IDEA添加MAVEN插件

作者:互联网

IntelliJ IDEA添加MAVEN插件
https://www.cnblogs.com/LaoJiangLJ/p/8973225.html

打开 File → Other Settings → Default Settings 
这里写图片描述

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

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

修改MAVEN安装路径下conf文件中的settion.xml文件
1.设置默认仓库地址(我这里设置的是本地D:\JAVATools\MvnRepo) 
这里写图片描述

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

<mirror>
        <id>alimaven</id>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
<span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirror</span>&gt;</span> 
   <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">id</span>&gt;</span>uk<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">id</span>&gt;</span>  
   <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirrorOf</span>&gt;</span>central<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirrorOf</span>&gt;</span>  
   <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">name</span>&gt;</span>Human Readable Name for this Mirror.<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">name</span>&gt;</span>  
   <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">url</span>&gt;</span>http://uk.maven.org/maven2/<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">url</span>&gt;</span> 
<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirror</span>&gt;</span>

<span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirror</span>&gt;</span>
   <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">id</span>&gt;</span>CN<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">id</span>&gt;</span>
   <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">name</span>&gt;</span>OSChina Central<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">name</span>&gt;</span>
   <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">url</span>&gt;</span>http://maven.oschina.net/content/groups/public/<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">url</span>&gt;</span>
   <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirrorOf</span>&gt;</span>central<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirrorOf</span>&gt;</span>
<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirror</span>&gt;</span>

<span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirror</span>&gt;</span>
  <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">id</span>&gt;</span>nexus<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">id</span>&gt;</span>
  <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">name</span>&gt;</span>internal nexus repository<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">name</span>&gt;</span>     
  <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">url</span>&gt;</span>http://repo.maven.apache.org/maven2<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">url</span>&gt;</span>
  <span class="hljs-tag"><span class="hljs-tag">&lt;</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirrorOf</span>&gt;</span>central<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirrorOf</span>&gt;</span>
<span class="hljs-tag"><span class="hljs-tag">&lt;/</span><span class="hljs-title"><span class="hljs-tag"><span class="hljs-name">mirror</span>&gt;</span><br><br>修改完setting.xml文件后将setting.xml文件复制一份到你刚刚定义的默认仓库地址中</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code></pre>

标签:插件,gt,IntelliJ,MAVEN,lt,mirror,mirrorOf,name
来源: https://www.cnblogs.com/sunny3158/p/15378541.html