Maven/SBT常用的repositorie一覽表

五柳-先生發表於2016-01-26

我們在用Maven編譯專案的時候有時老是出現無法下載某些jar依賴從而導致整個工程編譯失敗,這時候我們可以修改jar下載的源(也就是repositorie)即可,下面是Maven的用法,你可以在你專案的pom檔案裡面加入這些程式碼:

001 <!-- ********************************************** -->
002     <!-- **** REPOSITORIOS DEL PROYECTO **** -->
003     <!-- ********************************************** -->
004     <repositories>
005  
006         <!-- ****** RELEASE ****** -->
007         <repository>
008             <id>atlassian</id>
009             <url>http://maven.atlassian.com/repository/public</url>
010             <releases>
011                 <enabled>true</enabled>
012             </releases>
013             <snapshots>
014                 <enabled>false</enabled>
015             </snapshots>
016         </repository>
017  
018         <repository>
019             <id>maven.org.repo2</id>
020             <name>Repository of <span class="wp_keywordlink_affiliate"><a href="http://www.iteblog.com/archives/tag/maven"title="" target="_blank" data-original-title="View all posts in Maven">Maven</a></span>.org</name>
021             <url>http://search.maven.org/#search</url>
022         </repository>
023  
024         <repository>
025             <id>search.maven.org</id>
026             <name>Repository of Maven.org</name>
027             <url>http://search.maven.org</url>
028         </repository>
029  
030         <repository>
031             <id>itextpdf.com</id>
032             <name>Maven Repository for iText</name>
033             <url>http://maven.itextpdf.com</url>
034         </repository>
035  
036         <repository>
037             <id>repository.jboss.com</id>
038             <name>Jboss Repository for Maven</name>
039             <url>http://repository.jboss.com</url>
040         </repository>
041  
042         <repository>
043             <id>snapshots.jboss.org</id>
044             <name>Jboss Snapshot Repository for Maven</name>
045             <url>http://snapshots.jboss.org/maven2</url>
046         </repository>
047  
048         <repository>
049             <id>java.net</id>
050             <name>Repository of <span class="wp_keywordlink_affiliate"><a href="http://www.iteblog.com/archives/tag/java"title="" target="_blank" data-original-title="View all posts in Java">Java</a></span>.net</name>
051             <url>http://download.java.net/maven/1</url>
052         </repository>
053  
054         <repository>
055             <id>deltaset.org</id>
056             <name>Repository of Deltaset</name>
057             <url>http://deltaset.googlecode.com/svn/maven2</url>
058         </repository>
059  
060         <repository>
061             <id>prime.com</id>
062             <name>Repository of PrimeFaces</name>
063             <url>http://repository.prime.com.tr/org</url>
064         </repository>
065  
066         <repository>
067             <id>com.springsource.repository.maven.milestone</id>
068             <name>Spring Framework Maven Milestone Releases (Maven Central Format)</name>
069             <url>http://maven.springframework.org/milestone</url>
070         </repository>
071  
072         <repository>
073             <id>maven-repository2.dev.java.net</id>
074             <name><span class="wp_keywordlink_affiliate"><a href="http://www.iteblog.com/archives/tag/java"title="" target="_blank" data-original-title="View all posts in Java">Java</a></span>.net Repository forMaven 2</name>
075             <url>http://download.java.net/maven/2</url>
076         </repository>
077  
078         <repository>
079             <id>mvnrepository.com</id>
080             <name>mvnrepository.com</name>
081             <url>http://mvnrepository.com</url>
082         </repository>
083  
084         <repository>
085             <id>www.mvnbrowser.com</id>
086             <name>www.mvnbrowser.com</name>
087             <url>http://www.mvnbrowser.com</url>
088         </repository>
089  
090         <repository>
091             <id>objectweb</id>
092             <name>Objectweb repository</name>
093             <url>http://maven.objectweb.org/maven2</url>
094         </repository>
095  
096         <repository>
097             <id>ops4j.repository</id>
098             <name>OPS4J Repository</name>
099             <url>http://repository.ops4j.org/maven2</url>
100         </repository>
101  
102         <repository>
103             <id>Codehaus Snapshots</id>
104             <url>http://snapshots.repository.codehaus.org/</url>
105         </repository>
106  
107  
108         <!-- **** SNAPSHOTS **** -->
109         <repository>
110             <id>apache-maven-snapshots</id>
111             <name>Repository of Snapshots</name>
112             <url>http://repository.apache.org/snapshots</url>
113         </repository>
114  
115         <repository>
116             <id>apache.snapshots</id>
117             <name>ASF Maven 2 Snapshot</name>
118             <url>http://people.apache.org/builds/struts/2.1.8.1/m2-staging-repository</url>
119         </repository>
120  
121         <repository>
122             <id>com.springsource.repository.maven.snapshot</id>
123             <name>SpringSource Enterprise Bundle Maven Repository - SpringSource Snapshot Releases</name>
124             <url>http://maven.springframework.org/snapshot</url>
125         </repository>
126  
127     </repositories>

  如果你是用sbt進行編譯,可以用下面的程式碼加入新的repositories:

1 resolvers ++= Seq(
2         "maven Repository" at "http://repo1.maven.org/maven2/"

相關文章