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>
posted @ 2021-11-13 16:48  燃烧的竹子  阅读(103)  评论(0编辑  收藏  举报