阿里雲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/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM