maven 远程仓库



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.maven.org/maven2/</url>
         <mirrorOf>central</mirrorOf>  
</mirror>


如果不修改setting.xml ,也可以在你项目的pom.xml上加入
[html] view plain copy
在CODE上查看代码片派生到我的代码片

      <repositories> 
        <repository>   
           <id>oschinaRepository</id>   
           <name>local private nexus</name>   
           <url>http://maven.oschina.net/content/groups/public/</url>   
           <releases>   
               <enabled>true</enabled>   
           </releases>   
            <snapshots>   
                <enabled>true</enabled>   
            </snapshots>   
        </repository>   
    </repositories> 


常见仓库

共有的仓库
http://repo1.maven.org/maven2/
http://repository.jboss.com/maven2/
http://repository.sonatype.org/content/groups/public/
http://mirrors.ibiblio.org/pub/mirrors/maven2/org/acegisecurity/

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

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

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


对当前的项目有效。



猜你喜欢

转载自tangkuo.iteye.com/blog/2288562
今日推荐