Maven下载后配置

settings.xml配置

文件路径
如:E:\apache-maven-3.8.3\conf\settings.xml

设置本地库路径

Windows默认为C盘用户的根路径
C:\Users\用户名\

- <!--  localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  
  --> 
  <localRepository>E:/apache-maven-3.8.3/.m2/repository</localRepository> 

设置阿里云maven库

- <mirrors>
- <!--  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.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
    <mirror>
      <id>maven-default-http-blocker</id>
      <mirrorOf>external:http:*</mirrorOf>
      <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
      <url>http://0.0.0.0/</url>
      <blocked>true</blocked>
    </mirror>
     
  --> 
 <mirror>
  <id>nexus</id> 
  <name>aliyun Maven</name> 
  <mirrorOf>*</mirrorOf> 
  <url>http://maven.aliyun.com/nexus/content/groups/public</url>
 <!-- 
    <url>http://maven.tedu.cn/nexus/content/groups/public</url>
  --> 
 <!--  
    <url>http://maven.oschina.net/content/groups/public</url> 
  --> 
  </mirror>
  </mirrors>

作者: 燃烧的竹子
出处: https://www.cnblogs.com/HittheRoad/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
原文地址:https://www.cnblogs.com/HittheRoad/p/15549002.html