开源中国Maven镜像配置

最近时间段在弄maven的项目,发现在下载插件或依赖包时总是超时,经检查发现为连接国外网站时网速特慢,于是想找一个国内的镜像。经过谷歌之后发现了开源中国的镜像,速度还不错,于是记录下来,作为备忘。参考配置示例如下:

Xml代码   收藏代码
  1.  <mirrors>  
  2.    <mirror>  
  3.     <id>nexus-osc</id>  
  4.     <mirrorOf>central</mirrorOf>  
  5.     <name>Nexus osc</name>  
  6.     <url>http://maven.oschina.net/content/groups/public/</url>  
  7. </mirror>  
  8. <mirror>  
  9.     <id>nexus-osc-thirdparty</id>  
  10.     <mirrorOf>thirdparty</mirrorOf>  
  11.     <name>Nexus osc thirdparty</name>  
  12.     <url>http://maven.oschina.net/content/repositories/thirdparty/</url>  
  13. </mirror>  
  14.  </mirrors>  

 

Xml代码   收藏代码
  1. <profiles>  
  2.   
  3.   <profile>  
  4.     <id>jdk-1.4</id>  
  5.     <activation>  
  6.         <jdk>1.4</jdk>  
  7.     </activation>  
  8.             
  9.     <repositories>  
  10.         <repository>  
  11.             <id>nexus</id>  
  12.             <name>local private nexus</name>  
  13.             <url>http://maven.oschina.net/content/groups/public/</url>  
  14.             <releases>  
  15.                 <enabled>true</enabled>  
  16.             </releases>  
  17.             <snapshots>  
  18.                 <enabled>false</enabled>  
  19.             </snapshots>  
  20.           </repository>  
  21.     </repositories>  
  22.       <pluginRepositories>  
  23.         <pluginRepository>  
  24.             <id>nexus</id>  
  25.             <name>local private nexus</name>  
  26.             <url>http://maven.oschina.net/content/groups/public/</url>  
  27.             <releases>  
  28.                 <enabled>true</enabled>  
  29.             </releases>  
  30.             <snapshots>  
  31.                 <enabled>false</enabled>  
  32.             </snapshots>  
  33.         </pluginRepository>  
  34.       </pluginRepositories>  
  35.   </profile>  
  36.   <profile>  
  37.     <id>osc</id>  
  38.     <activation>  
  39.         <activeByDefault>true</activeByDefault>  
  40.     </activation>  
  41.     <repositories>  
  42.         <repository>  
  43.             <id>osc</id>  
  44.               <url>http://maven.oschina.net/content/groups/public/</url>  
  45.         </repository>  
  46.         <repository>  
  47.             <id>osc_thirdparty</id>  
  48.             <url>http://maven.oschina.net/content/repositories/thirdparty/</url>  
  49.         </repository>  
  50.       </repositories>  
  51.     <pluginRepositories>  
  52.         <pluginRepository>  
  53.             <id>osc</id>  
  54.             <url>http://maven.oschina.net/content/groups/public/</url>  
  55.           </pluginRepository>  
  56.     </pluginRepositories>  
  57.   </profile>  
  58. </profiles>  

 详细信息可查看:http://maven.oschina.net/help.html

你可能感兴趣的:(开源中国Maven镜像配置)