阿里云Maven配置,Maven仓库配置,Maven镜像配置

 

阿里云Maven配置,Maven仓库配置,Maven镜像配置

========================

蕃薯耀 2018年1月29日

http://www.cnblogs.com/fanshuyao/

 

一、setting.xml文件配置镜像

找到mirrors镜像节点,增加mirror节点,如下所示:

Xml代码  收藏代码
  1. <mirrors>  
  2.     <!-- mirror  
  3.      | Specifies a repository mirror site to use instead of a given repository. The repository that  
  4.      | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used  
  5.      | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.  
  6.      |  
  7.     <mirror>  
  8.       <id>mirrorId</id>  
  9.       <mirrorOf>repositoryId</mirrorOf>  
  10.       <name>Human Readable Name for this Mirror.</name>  
  11.       <url>http://my.repository.com/repo/path</url>  
  12.     </mirror>  
  13.      -->  
  14.      <mirror>  
  15.       <id>alimaven</id>  
  16.       <mirrorOf>central</mirrorOf>  
  17.       <name>aliyun maven</name>  
  18.       <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
  19.     </mirror>  
  20.   </mirrors>  

 

 

二、本地Jar包仓库配置

在setting.xml文件中找点localRepository节点,具体配置如下:

路径自己定义

Xml代码  收藏代码
  1. <!-- localRepository  
  2.  | The path to the local repository maven will use to store artifacts.  
  3.  |  
  4.  | Default: ${user.home}/.m2/repository  
  5. <localRepository>/path/to/local/repo</localRepository>  
  6. -->  
  7. <localRepository>D:\0soft\repository</localRepository>  

 

 

 

三、pom.xml文件仓库配置

 

Xml代码  收藏代码
  1. <repositories>    
  2.         <repository>    
  3.             <id>alimaven</id>    
  4.             <name>aliyun maven</name>    
  5.             <url>http://maven.aliyun.com/nexus/content/groups/public/</url>    
  6.         </repository>  
  7.     </repositories>  

 

 

 

========================

蕃薯耀 2018年1月29日

http://www.cnblogs.com/fanshuyao/

posted @ 2018-01-29 10:25  蕃薯耀  阅读(4856)  评论(1编辑  收藏  举报