maven 相关

一、安装之后本地没有生成.m2文件夹

mvn help:system

二、下载依赖包慢的问题

有时候我们下载依赖包时特别慢,那是因为很多资源都是国外的,解决办法是修改下镜像路径,在settings.xml中,找到镜像标签,

<!-- 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>
     -->

在里面添加国内镜像,例如:

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

 

posted @ 2019-04-13 09:54  BillyYang  阅读(146)  评论(0编辑  收藏  举报