maven远程仓库配置

来源:互联网 发布:明英宗复辟知乎 编辑:程序博客网 时间:2024/06/04 23:01

配置方法1: 在 $MAVEN_HOME/conf 下的 settings.xml 的<mirrors>标签中添加如下配置:

  1. <mirror>  
  2.   <id>alimaven</id>  
  3.   <name>aliyun maven</name>  
  4.   <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
  5.   <mirrorOf>central</mirrorOf>          
  6. </mirror>  

配置方法2: 在 pom.xml 中直接添加

  1. <repositories><!-- 代码库 -->  
  2.     <repository>  
  3.         <id>maven-ali</id>  
  4.         <url>http://maven.aliyun.com/nexus/content/groups/public//</url>  
  5.         <releases>  
  6.             <enabled>true</enabled>  
  7.         </releases>  
  8.         <snapshots>  
  9.             <enabled>true</enabled>  
  10.             <updatePolicy>always</updatePolicy>  
  11.             <checksumPolicy>fail</checksumPolicy>  
  12.         </snapshots>  
  13.     </repository>  
  14. </repositories> 

原创粉丝点击