eclipse的 preferences -> maven -> User Settings 你就可以看到你的setting.xml文件的地址了,。
然后將setting.xml文件打開,。修改里面的mirror節(jié)點(diǎn) 。url指向遠(yuǎn)程倉(cāng)庫(kù)的地址,。 這樣設(shè)置之后你的所有項(xiàng)目都有作用,。
<mirror>
<id>central_mirror</id>
<name>internal central_mirror epository</name>
<url>http://repo1./maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
如果不修改setting.xml ,也可以在你項(xiàng)目的pom.xml上加入
- <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>
常見倉(cāng)庫(kù)
共有的倉(cāng)庫(kù)
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/
私有的倉(cāng)庫(kù)
http://repository./
http://snapshots.repository./
http://people./repo/m2-snapshot-repository
http://people./repo/m2-incubating-repository/
對(duì)當(dāng)前的項(xiàng)目有效,。
|