分享

maven 远程仓库

 馆天下ccf 2015-06-08

eclipse的 preferences -> maven -> User Settings  你就可以看到你的setting.xml文件的地址了。
 然后将setting.xml文件打开。修改里面的mirror节点 。url指向远程仓库的地址。 这样设置之后你的所有项目都有作用。
 <mirror> 
         <id>central_mirror</id> 
         <name>internal central_mirror epository</name> 
         <url>http://repo1./maven2/</url>
         <mirrorOf>central</mirrorOf>   
 </mirror>
 

如果不修改setting.xml ,也可以在你项目的pom.xml上加入 

  1.   <repositories>  
  2.     <repository>    
  3.        <id>oschinaRepository</id>    
  4.        <name>local private nexus</name>    
  5.        <url>http://maven.oschina.net/content/groups/public/</url>    
  6.        <releases>    
  7.            <enabled>true</enabled>    
  8.        </releases>    
  9.         <snapshots>    
  10.             <enabled>true</enabled>    
  11.         </snapshots>    
  12.     </repository>    
  13. </repositories>  


常见仓库

共有的仓库
http://repo1./maven2/
http://repository./maven2/
http://repository./content/groups/public/
http://mirrors./pub/mirrors/maven2/org/acegisecurity/

http://maven./content/groups/glassfish/

https://nexus./nexus/content/repositories/public/

私有的仓库
http://repository./
http://snapshots.repository./
http://people./repo/m2-snapshot-repository
http://people./repo/m2-incubating-repository/

 

 

 对当前的项目有效。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多