Configuring maven local repository, maven central repository configuration Ali, eclipse maven configuration

A, maven local repository path configuration

1. Open the downloaded maven directory (if not installed, you can look at what I wrote installation steps)

2. Go conf -> Edit File setting.xml

3. Locate and modify <localRepository>, initially commented out, uncomment you can <localRepository> you want to store local repository path </ localRepository>

(Not modify the default $ {user.home} /. M2 / repository this path)

Second, configure the central warehouse

I use the central warehouse Ali, NetEase can also be used, or the Apache (with a little country will be faster)

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

  </mirrors>

Third, configure the local warehouse

The conf / settings.xml in maven just modify the copy to your local repository copy is just a modified <localRepository> in the path

 

Four, eclipse associated with the local warehouse

1.

2. Add a new search maven

3. Select the root directory of the local maven downloaded

4. Select the Add good path maven

 

5.添加本地仓库的setting.xml

 

6.检查eclipse开发工具中maven仓库是否配置完成

 

 双击Maven Repostories

右键

下面有本地仓库已经存在的文件就成功了

 

接下来就可以在eclipse里创建maven项目了

 

 

对于maven仓库的理解可参考:https://www.runoob.com/maven/maven-repositories.html

Guess you like

Origin www.cnblogs.com/xjd-6/p/11345577.html